com0com-cvs Mailing List for Null-modem emulator (Page 14)
The virtual serial port driver for Windows.
Brought to you by:
vfrolov
You can subscribe to this list here.
2005 |
Jan
|
Feb
(7) |
Mar
|
Apr
|
May
(13) |
Jun
(18) |
Jul
(9) |
Aug
(10) |
Sep
(15) |
Oct
(6) |
Nov
(9) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(6) |
Feb
(4) |
Mar
(4) |
Apr
(2) |
May
(7) |
Jun
(11) |
Jul
(6) |
Aug
(9) |
Sep
(1) |
Oct
(27) |
Nov
(22) |
Dec
(3) |
2007 |
Jan
(13) |
Feb
(16) |
Mar
(2) |
Apr
(3) |
May
(7) |
Jun
(17) |
Jul
(9) |
Aug
(1) |
Sep
(13) |
Oct
(20) |
Nov
(18) |
Dec
(1) |
2008 |
Jan
|
Feb
(3) |
Mar
(46) |
Apr
(40) |
May
(4) |
Jun
(9) |
Jul
(7) |
Aug
(62) |
Sep
(25) |
Oct
(51) |
Nov
(67) |
Dec
(81) |
2009 |
Jan
(13) |
Feb
(31) |
Mar
(12) |
Apr
|
May
(10) |
Jun
|
Jul
(5) |
Aug
(2) |
Sep
(10) |
Oct
|
Nov
(3) |
Dec
(1) |
2010 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
(12) |
Jun
(9) |
Jul
(12) |
Aug
(7) |
Sep
(6) |
Oct
|
Nov
|
Dec
(1) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(11) |
Jun
|
Jul
(26) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(23) |
2012 |
Jan
(7) |
Feb
(3) |
Mar
|
Apr
|
May
(2) |
Jun
(9) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Vyacheslav F. <vf...@us...> - 2008-11-24 16:31:02
|
Update of /cvsroot/com0com/hub4com/plugins In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1198/plugins Modified Files: plugins_api.h Log Message: Removed pOnXoffXon Index: plugins_api.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/plugins_api.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** plugins_api.h 24 Nov 2008 12:36:59 -0000 1.18 --- plugins_api.h 24 Nov 2008 16:30:56 -0000 1.19 *************** *** 53,56 **** --- 53,58 ---- #define VAL2LC_STOPBITS(v) ((DWORD)(BYTE)(v) << 16) /*******************************************************************/ + #define HUB_MSG_ROUTE_FLOW_CONTROL 0x0080 + /*******************************************************************/ #define HUB_MSG_TYPE_EMPTY (0 | HUB_MSG_UNION_TYPE_NONE) #define HUB_MSG_TYPE_LINE_DATA (1 | HUB_MSG_UNION_TYPE_BUF) *************** *** 123,127 **** #define HUB_MSG_TYPE_LLC_STATUS (19 | HUB_MSG_UNION_TYPE_VAL | HUB_MSG_VAL_TYPE_LC) #define HUB_MSG_TYPE_LOOP_TEST (20 | HUB_MSG_UNION_TYPE_HVAL) ! #define HUB_MSG_TYPE_ADD_XOFF_XON (21 | HUB_MSG_UNION_TYPE_VAL | HUB_MSG_VAL_TYPE_BOOL) /*******************************************************************/ typedef struct _HUB_MSG { --- 125,129 ---- #define HUB_MSG_TYPE_LLC_STATUS (19 | HUB_MSG_UNION_TYPE_VAL | HUB_MSG_VAL_TYPE_LC) #define HUB_MSG_TYPE_LOOP_TEST (20 | HUB_MSG_UNION_TYPE_HVAL) ! #define HUB_MSG_TYPE_ADD_XOFF_XON (21 | HUB_MSG_ROUTE_FLOW_CONTROL | HUB_MSG_UNION_TYPE_VAL | HUB_MSG_VAL_TYPE_BOOL) /*******************************************************************/ typedef struct _HUB_MSG { *************** *** 176,182 **** typedef const char *(CALLBACK ROUTINE_FILTER_NAME_A)( HMASTERFILTER hMasterFilter); - typedef void (CALLBACK ROUTINE_ON_XOFF_XON)( - HMASTERPORT hMasterPort, - BOOL xoff); typedef void (CALLBACK ROUTINE_ON_READ)( HMASTERPORT hMasterPort, --- 178,181 ---- *************** *** 195,199 **** ROUTINE_PORT_NAME_A *pPortName; ROUTINE_FILTER_NAME_A *pFilterName; - ROUTINE_ON_XOFF_XON *pOnXoffXon; ROUTINE_ON_READ *pOnRead; } HUB_ROUTINES_A; --- 194,197 ---- |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 16:31:02
|
Update of /cvsroot/com0com/hub4com In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1198 Modified Files: comhub.cpp comhub.h export.cpp Log Message: Removed pOnXoffXon Index: export.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/export.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** export.cpp 24 Nov 2008 12:46:16 -0000 1.6 --- export.cpp 24 Nov 2008 16:30:56 -0000 1.7 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.7 2008/11/24 16:30:56 vfrolov + * Removed pOnXoffXon + * * Revision 1.6 2008/11/24 12:46:16 vfrolov * Changed plugin API *************** *** 203,214 **** } /////////////////////////////////////////////////////////////// - static void CALLBACK on_xoff_xon(HMASTERPORT hMasterPort, BOOL xoff) - { - _ASSERTE(hMasterPort != NULL); - _ASSERTE(((Port *)hMasterPort)->IsValid()); - - ((Port *)hMasterPort)->hub.AddXoffXon((Port *)hMasterPort, xoff); - } - /////////////////////////////////////////////////////////////// static void CALLBACK on_read(HMASTERPORT hMasterPort, HUB_MSG *pMsg) { --- 206,209 ---- *************** *** 236,240 **** port_name, filter_name, - on_xoff_xon, on_read, }; --- 231,234 ---- Index: comhub.h =================================================================== RCS file: /cvsroot/com0com/hub4com/comhub.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** comhub.h 24 Nov 2008 12:36:59 -0000 1.9 --- comhub.h 24 Nov 2008 16:30:56 -0000 1.10 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.10 2008/11/24 16:30:56 vfrolov + * Removed pOnXoffXon + * * Revision 1.9 2008/11/24 12:36:59 vfrolov * Changed plugin API *************** *** 87,91 **** BOOL OnFakeRead(Port *pFromPort, HubMsg *pMsg) const; void OnRead(Port *pFromPort, HubMsg *pMsg) const; - void AddXoffXon(Port *pFromPort, BOOL xoff) const; void LostReport() const; void SetDataRoute(const PortMap &map) { routeDataMap = map; } --- 90,93 ---- *************** *** 108,113 **** private: - void OnRead(const PortMap &routeMap, Port *pFromPort, HubMsg *pMsg) const; - Ports ports; PortMap routeDataMap; --- 110,113 ---- Index: comhub.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/comhub.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** comhub.cpp 24 Nov 2008 12:36:59 -0000 1.12 --- comhub.cpp 24 Nov 2008 16:30:56 -0000 1.13 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.13 2008/11/24 16:30:56 vfrolov + * Removed pOnXoffXon + * * Revision 1.12 2008/11/24 12:36:59 vfrolov * Changed plugin API *************** *** 177,195 **** void ComHub::OnRead(Port *pFromPort, HubMsg *pMsg) const { - OnRead(routeDataMap, pFromPort, pMsg); - } - - void ComHub::AddXoffXon(Port *pFromPort, BOOL xoff) const - { - HubMsg msg; - - msg.type = HUB_MSG_TYPE_ADD_XOFF_XON; - msg.u.val = xoff; - - OnRead(routeFlowControlMap, pFromPort, &msg); - } - - void ComHub::OnRead(const PortMap &routeMap, Port *pFromPort, HubMsg *pMsg) const - { _ASSERTE(pFromPort != NULL); _ASSERTE(pMsg != NULL); --- 180,183 ---- *************** *** 212,215 **** --- 200,205 ---- } + const PortMap &routeMap = (pMsg->type & HUB_MSG_ROUTE_FLOW_CONTROL) ? routeFlowControlMap : routeDataMap; + for (PortMap::const_iterator i = routeMap.find(pFromPort) ; i != routeMap.end() ; i++) { if (i->first != pFromPort) |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 16:31:02
|
Update of /cvsroot/com0com/hub4com/plugins/tcp In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1198/plugins/tcp Modified Files: comport.cpp comport.h import.h port.cpp Log Message: Removed pOnXoffXon Index: comport.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comport.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** comport.cpp 24 Nov 2008 12:37:00 -0000 1.9 --- comport.cpp 24 Nov 2008 16:30:56 -0000 1.10 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.10 2008/11/24 16:30:56 vfrolov + * Removed pOnXoffXon + * * Revision 1.9 2008/11/24 12:37:00 vfrolov * Changed plugin API *************** *** 132,138 **** --- 135,145 ---- writeQueueLimit(256), writeQueued(0), + writeSuspended(FALSE), writeLost(0), writeLostTotal(0) { + writeQueueLimitSendXoff = (writeQueueLimit*2)/3; + writeQueueLimitSendXon = writeQueueLimit/3; + string path; *************** *** 330,338 **** } - if (writeQueued <= writeQueueLimit/2 && (writeQueued + len) > writeQueueLimit/2) - pOnXoffXon(hMasterPort, TRUE); - writeQueued += len; //cout << "Started Write " << name << " " << len << " " << writeQueued << endl; } --- 337,353 ---- } writeQueued += len; + if (writeQueued > writeQueueLimitSendXoff && !writeSuspended) { + writeSuspended = TRUE; + + HUB_MSG msg; + + msg.type = HUB_MSG_TYPE_ADD_XOFF_XON; + msg.u.val = TRUE; + + pOnRead(hMasterPort, &msg); + } + //cout << "Started Write " << name << " " << len << " " << writeQueued << endl; } *************** *** 409,416 **** writeLost += len - done; - if (writeQueued > writeQueueLimit/2 && (writeQueued - len) <= writeQueueLimit/2) - pOnXoffXon(hMasterPort, FALSE); - writeQueued -= len; } --- 424,439 ---- writeLost += len - done; writeQueued -= len; + + if (writeQueued <= writeQueueLimitSendXon && writeSuspended) { + writeSuspended = FALSE; + + HUB_MSG msg; + + msg.type = HUB_MSG_TYPE_ADD_XOFF_XON; + msg.u.val = FALSE; + + pOnRead(hMasterPort, &msg); + } } Index: import.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/import.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** import.h 24 Nov 2008 12:37:00 -0000 1.3 --- import.h 24 Nov 2008 16:30:56 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.4 2008/11/24 16:30:56 vfrolov + * Removed pOnXoffXon + * * Revision 1.3 2008/11/24 12:37:00 vfrolov * Changed plugin API *************** *** 37,41 **** extern ROUTINE_BUF_ALLOC *pBufAlloc; extern ROUTINE_BUF_FREE *pBufFree; - extern ROUTINE_ON_XOFF_XON *pOnXoffXon; extern ROUTINE_ON_READ *pOnRead; /////////////////////////////////////////////////////////////// --- 40,43 ---- Index: port.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/port.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** port.cpp 24 Nov 2008 12:37:00 -0000 1.8 --- port.cpp 24 Nov 2008 16:30:56 -0000 1.9 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.9 2008/11/24 16:30:56 vfrolov + * Removed pOnXoffXon + * * Revision 1.8 2008/11/24 12:37:00 vfrolov * Changed plugin API *************** *** 296,300 **** ROUTINE_BUF_ALLOC *pBufAlloc; ROUTINE_BUF_FREE *pBufFree; - ROUTINE_ON_XOFF_XON *pOnXoffXon; ROUTINE_ON_READ *pOnRead; /////////////////////////////////////////////////////////////// --- 299,302 ---- *************** *** 305,309 **** if (!ROUTINE_IS_VALID(pHubRoutines, pBufAlloc) || !ROUTINE_IS_VALID(pHubRoutines, pBufFree) || - !ROUTINE_IS_VALID(pHubRoutines, pOnXoffXon) || !ROUTINE_IS_VALID(pHubRoutines, pOnRead)) { --- 307,310 ---- *************** *** 313,317 **** pBufAlloc = pHubRoutines->pBufAlloc; pBufFree = pHubRoutines->pBufFree; - pOnXoffXon = pHubRoutines->pOnXoffXon; pOnRead = pHubRoutines->pOnRead; --- 314,317 ---- Index: comport.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comport.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** comport.h 24 Nov 2008 12:37:00 -0000 1.6 --- comport.h 24 Nov 2008 16:30:56 -0000 1.7 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.7 2008/11/24 16:30:56 vfrolov + * Removed pOnXoffXon + * * Revision 1.6 2008/11/24 12:37:00 vfrolov * Changed plugin API *************** *** 129,133 **** --- 132,139 ---- DWORD writeQueueLimit; + DWORD writeQueueLimitSendXoff; + DWORD writeQueueLimitSendXon; DWORD writeQueued; + BOOL writeSuspended; DWORD writeLost; DWORD writeLostTotal; |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 16:31:02
|
Update of /cvsroot/com0com/hub4com/plugins/serial In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1198/plugins/serial Modified Files: comport.cpp comport.h import.h port.cpp Log Message: Removed pOnXoffXon Index: comport.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/comport.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** comport.cpp 24 Nov 2008 12:37:00 -0000 1.16 --- comport.cpp 24 Nov 2008 16:30:56 -0000 1.17 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.17 2008/11/24 16:30:56 vfrolov + * Removed pOnXoffXon + * * Revision 1.16 2008/11/24 12:37:00 vfrolov * Changed plugin API *************** *** 120,127 **** --- 123,134 ---- writeQueueLimit(256), writeQueued(0), + writeSuspended(FALSE), writeLost(0), writeLostTotal(0), errors(0) { + writeQueueLimitSendXoff = (writeQueueLimit*2)/3; + writeQueueLimitSendXon = writeQueueLimit/3; + filterX = comParams.InX(); string path(pPath); *************** *** 515,523 **** } - if (writeQueued <= writeQueueLimit/2 && (writeQueued + len) > writeQueueLimit/2) - pOnXoffXon(hMasterPort, TRUE); - writeQueued += len; //cout << name << " Started Write " << len << " " << writeQueued << endl; } --- 522,538 ---- } writeQueued += len; + if (writeQueued > writeQueueLimitSendXoff && !writeSuspended) { + writeSuspended = TRUE; + + HUB_MSG msg; + + msg.type = HUB_MSG_TYPE_ADD_XOFF_XON; + msg.u.val = TRUE; + + pOnRead(hMasterPort, &msg); + } + //cout << name << " Started Write " << len << " " << writeQueued << endl; } *************** *** 720,727 **** writeLost += len - done; - if (writeQueued > writeQueueLimit/2 && (writeQueued - len) <= writeQueueLimit/2) - pOnXoffXon(hMasterPort, FALSE); - writeQueued -= len; } --- 735,750 ---- writeLost += len - done; writeQueued -= len; + + if (writeQueued <= writeQueueLimitSendXon && writeSuspended) { + writeSuspended = FALSE; + + HUB_MSG msg; + + msg.type = HUB_MSG_TYPE_ADD_XOFF_XON; + msg.u.val = FALSE; + + pOnRead(hMasterPort, &msg); + } } Index: import.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/import.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** import.h 24 Nov 2008 12:37:00 -0000 1.4 --- import.h 24 Nov 2008 16:30:56 -0000 1.5 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.5 2008/11/24 16:30:56 vfrolov + * Removed pOnXoffXon + * * Revision 1.4 2008/11/24 12:37:00 vfrolov * Changed plugin API *************** *** 41,45 **** extern ROUTINE_BUF_FREE *pBufFree; extern ROUTINE_MSG_INSERT_NONE *pMsgInsertNone; - extern ROUTINE_ON_XOFF_XON *pOnXoffXon; extern ROUTINE_ON_READ *pOnRead; /////////////////////////////////////////////////////////////// --- 44,47 ---- Index: port.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/port.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** port.cpp 24 Nov 2008 12:37:00 -0000 1.10 --- port.cpp 24 Nov 2008 16:30:56 -0000 1.11 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.11 2008/11/24 16:30:56 vfrolov + * Removed pOnXoffXon + * * Revision 1.10 2008/11/24 12:37:00 vfrolov * Changed plugin API *************** *** 359,363 **** ROUTINE_BUF_FREE *pBufFree; ROUTINE_MSG_INSERT_NONE *pMsgInsertNone; - ROUTINE_ON_XOFF_XON *pOnXoffXon; ROUTINE_ON_READ *pOnRead; /////////////////////////////////////////////////////////////// --- 362,365 ---- *************** *** 369,373 **** !ROUTINE_IS_VALID(pHubRoutines, pBufFree) || !ROUTINE_IS_VALID(pHubRoutines, pMsgInsertNone) || - !ROUTINE_IS_VALID(pHubRoutines, pOnXoffXon) || !ROUTINE_IS_VALID(pHubRoutines, pOnRead)) { --- 371,374 ---- *************** *** 378,382 **** pBufFree = pHubRoutines->pBufFree; pMsgInsertNone = pHubRoutines->pMsgInsertNone; - pOnXoffXon = pHubRoutines->pOnXoffXon; pOnRead = pHubRoutines->pOnRead; --- 379,382 ---- Index: comport.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/comport.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** comport.h 24 Nov 2008 12:37:00 -0000 1.11 --- comport.h 24 Nov 2008 16:30:56 -0000 1.12 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.12 2008/11/24 16:30:56 vfrolov + * Removed pOnXoffXon + * * Revision 1.11 2008/11/24 12:37:00 vfrolov * Changed plugin API *************** *** 126,130 **** --- 129,136 ---- DWORD writeQueueLimit; + DWORD writeQueueLimitSendXoff; + DWORD writeQueueLimitSendXon; DWORD writeQueued; + BOOL writeSuspended; DWORD writeLost; DWORD writeLostTotal; |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 12:46:23
|
Update of /cvsroot/com0com/hub4com In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32684 Modified Files: export.cpp Log Message: Changed plugin API Index: export.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/export.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** export.cpp 13 Nov 2008 08:07:40 -0000 1.5 --- export.cpp 24 Nov 2008 12:46:16 -0000 1.6 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.6 2008/11/24 12:46:16 vfrolov + * Changed plugin API + * * Revision 1.5 2008/11/13 08:07:40 vfrolov * Changed for staticaly linking *************** *** 45,48 **** --- 48,52 ---- #include "bufutils.h" #include "hubmsg.h" + #include "filter.h" /////////////////////////////////////////////////////////////// *************** *** 59,68 **** static BOOL CALLBACK msg_replace_buf(HUB_MSG *pMsg, WORD type, const BYTE *pSrc, DWORD sizeSrc) { ! _ASSERTE((type & HUB_MSG_UNION_TYPE_MASK) == HUB_MSG_UNION_TYPE_BUF); if (!pMsg) return FALSE; ! if ((pMsg->type & HUB_MSG_UNION_TYPE_MASK) != HUB_MSG_UNION_TYPE_BUF) ((HubMsg *)pMsg)->Clean(); --- 63,72 ---- static BOOL CALLBACK msg_replace_buf(HUB_MSG *pMsg, WORD type, const BYTE *pSrc, DWORD sizeSrc) { ! _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_BUF); if (!pMsg) return FALSE; ! if ((pMsg->type & HUB_MSG_UNION_TYPES_MASK) != HUB_MSG_UNION_TYPE_BUF) ((HubMsg *)pMsg)->Clean(); *************** *** 82,86 **** static HUB_MSG *CALLBACK msg_insert_buf(HUB_MSG *pPrevMsg, WORD type, const BYTE *pSrc, DWORD sizeSrc) { ! _ASSERTE((type & HUB_MSG_UNION_TYPE_MASK) == HUB_MSG_UNION_TYPE_BUF); if (pPrevMsg && pPrevMsg->type == type) { --- 86,90 ---- static HUB_MSG *CALLBACK msg_insert_buf(HUB_MSG *pPrevMsg, WORD type, const BYTE *pSrc, DWORD sizeSrc) { ! _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_BUF); if (pPrevMsg && pPrevMsg->type == type) { *************** *** 117,121 **** static BOOL CALLBACK msg_replace_val(HUB_MSG *pMsg, WORD type, DWORD val) { ! _ASSERTE((type & HUB_MSG_UNION_TYPE_MASK) == HUB_MSG_UNION_TYPE_VAL); if (!pMsg) --- 121,125 ---- static BOOL CALLBACK msg_replace_val(HUB_MSG *pMsg, WORD type, DWORD val) { ! _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_VAL); if (!pMsg) *************** *** 132,136 **** static HUB_MSG *CALLBACK msg_insert_val(HUB_MSG *pPrevMsg, WORD type, DWORD val) { ! _ASSERTE((type & HUB_MSG_UNION_TYPE_MASK) == HUB_MSG_UNION_TYPE_VAL); HubMsg *pMsg = new HubMsg(); --- 136,140 ---- static HUB_MSG *CALLBACK msg_insert_val(HUB_MSG *pPrevMsg, WORD type, DWORD val) { ! _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_VAL); HubMsg *pMsg = new HubMsg(); *************** *** 152,156 **** static BOOL CALLBACK msg_replace_none(HUB_MSG *pMsg, WORD type) { ! _ASSERTE((type & HUB_MSG_UNION_TYPE_MASK) == HUB_MSG_UNION_TYPE_NONE); if (!pMsg) --- 156,160 ---- static BOOL CALLBACK msg_replace_none(HUB_MSG *pMsg, WORD type) { ! _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_NONE); if (!pMsg) *************** *** 166,170 **** static HUB_MSG *CALLBACK msg_insert_none(HUB_MSG *pPrevMsg, WORD type) { ! _ASSERTE((type & HUB_MSG_UNION_TYPE_MASK) == HUB_MSG_UNION_TYPE_NONE); HubMsg *pMsg = new HubMsg(); --- 170,174 ---- static HUB_MSG *CALLBACK msg_insert_none(HUB_MSG *pPrevMsg, WORD type) { ! _ASSERTE((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_NONE); HubMsg *pMsg = new HubMsg(); *************** *** 183,239 **** } /////////////////////////////////////////////////////////////// ! static int CALLBACK num_ports(HHUB hHub) ! { ! _ASSERTE(hHub != NULL); ! _ASSERTE(((ComHub *)hHub)->IsValid()); ! ! return ((ComHub *)hHub)->NumPorts(); ! } ! /////////////////////////////////////////////////////////////// ! static const char * CALLBACK port_name(HHUB hHub, int n) ! { ! _ASSERTE(hHub != NULL); ! _ASSERTE(((ComHub *)hHub)->IsValid()); ! ! Port *pPort = ((ComHub *)hHub)->GetPort(n); ! ! if (!pPort) ! return NULL; ! ! return pPort->Name().c_str(); ! } ! /////////////////////////////////////////////////////////////// ! static const char * CALLBACK filter_name(HHUB hHub, HFILTER hFilter) { ! _ASSERTE(hHub != NULL); ! _ASSERTE(((ComHub *)hHub)->IsValid()); ! return ((ComHub *)hHub)->FilterName(hFilter); } /////////////////////////////////////////////////////////////// ! static void CALLBACK on_xoff(HHUB hHub, HMASTERPORT hMasterPort) { ! _ASSERTE(hHub != NULL); ! _ASSERTE(((ComHub *)hHub)->IsValid()); ! _ASSERTE(hMasterPort != NULL); ! _ASSERTE(((Port *)hMasterPort)->IsValid()); ! ((ComHub *)hHub)->AddXoff((Port *)hMasterPort); } /////////////////////////////////////////////////////////////// ! static void CALLBACK on_xon(HHUB hHub, HMASTERPORT hMasterPort) { - _ASSERTE(hHub != NULL); - _ASSERTE(((ComHub *)hHub)->IsValid()); _ASSERTE(hMasterPort != NULL); _ASSERTE(((Port *)hMasterPort)->IsValid()); ! ((ComHub *)hHub)->AddXon((Port *)hMasterPort); } /////////////////////////////////////////////////////////////// ! static void CALLBACK on_read(HHUB hHub, HMASTERPORT hMasterPort, HUB_MSG *pMsg) { - _ASSERTE(hHub != NULL); - _ASSERTE(((ComHub *)hHub)->IsValid()); _ASSERTE(hMasterPort != NULL); _ASSERTE(((Port *)hMasterPort)->IsValid()); --- 187,216 ---- } /////////////////////////////////////////////////////////////// ! static const char * CALLBACK port_name(HMASTERPORT hMasterPort) { ! _ASSERTE(hMasterPort != NULL); ! _ASSERTE(((Port *)hMasterPort)->IsValid()); ! return ((Port *)hMasterPort)->Name().c_str(); } /////////////////////////////////////////////////////////////// ! static const char * CALLBACK filter_name(HMASTERFILTER hMasterFilter) { ! _ASSERTE(hMasterFilter != NULL); ! _ASSERTE(((Filter *)hMasterFilter)->IsValid()); ! return ((Filter *)hMasterFilter)->name.c_str(); } /////////////////////////////////////////////////////////////// ! static void CALLBACK on_xoff_xon(HMASTERPORT hMasterPort, BOOL xoff) { _ASSERTE(hMasterPort != NULL); _ASSERTE(((Port *)hMasterPort)->IsValid()); ! ((Port *)hMasterPort)->hub.AddXoffXon((Port *)hMasterPort, xoff); } /////////////////////////////////////////////////////////////// ! static void CALLBACK on_read(HMASTERPORT hMasterPort, HUB_MSG *pMsg) { _ASSERTE(hMasterPort != NULL); _ASSERTE(((Port *)hMasterPort)->IsValid()); *************** *** 244,248 **** ::memset(pMsg, 0, sizeof(*pMsg)); ! ((ComHub *)hHub)->OnRead((Port *)hMasterPort, &msg); } /////////////////////////////////////////////////////////////// --- 221,225 ---- ::memset(pMsg, 0, sizeof(*pMsg)); ! ((Port *)hMasterPort)->hub.OnRead((Port *)hMasterPort, &msg); } /////////////////////////////////////////////////////////////// *************** *** 257,265 **** msg_replace_none, msg_insert_none, - num_ports, port_name, filter_name, ! on_xoff, ! on_xon, on_read, }; --- 234,240 ---- msg_replace_none, msg_insert_none, port_name, filter_name, ! on_xoff_xon, on_read, }; |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 12:37:13
|
Update of /cvsroot/com0com/hub4com In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31238 Modified Files: comhub.cpp comhub.h filters.cpp filters.h hub4com.cpp hubmsg.cpp plugins.cpp plugins.h port.cpp port.h route.cpp route.h Log Message: Changed plugin API Index: port.h =================================================================== RCS file: /cvsroot/com0com/hub4com/port.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** port.h 13 Nov 2008 08:07:40 -0000 1.3 --- port.h 24 Nov 2008 12:36:59 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.4 2008/11/24 12:36:59 vfrolov + * Changed plugin API + * * Revision 1.3 2008/11/13 08:07:40 vfrolov * Changed for staticaly linking *************** *** 43,47 **** { public: ! Port(ComHub &_hub, int _num, const PORT_ROUTINES_A *pPortRoutines, HPORT _hPort); #ifdef _DEBUG --- 46,50 ---- { public: ! Port(ComHub &_hub, int _num); #ifdef _DEBUG *************** *** 52,77 **** #endif ! BOOL Init(); BOOL Start(); BOOL FakeReadFilter(HubMsg *pMsg); BOOL Write(HubMsg *pMsg); - void AddXoff(); - void AddXon(); const string &Name() const { return name; } int Num() const { return num; } void LostReport(); ! private: ComHub &hub; int num; string name; HPORT hPort; - PORT_INIT *pInit; PORT_START *pStart; PORT_FAKE_READ_FILTER *pFakeReadFilter; PORT_WRITE *pWrite; - PORT_ADD_XOFF *pAddXoff; - PORT_ADD_XON *pAddXon; PORT_LOST_REPORT *pLostReport; --- 55,80 ---- #endif ! BOOL Init( ! const PORT_ROUTINES_A *pPortRoutines, ! HCONFIG hConfig, ! const char *pPath); BOOL Start(); BOOL FakeReadFilter(HubMsg *pMsg); BOOL Write(HubMsg *pMsg); const string &Name() const { return name; } int Num() const { return num; } void LostReport(); ! public: ComHub &hub; + + private: int num; string name; HPORT hPort; PORT_START *pStart; PORT_FAKE_READ_FILTER *pFakeReadFilter; PORT_WRITE *pWrite; PORT_LOST_REPORT *pLostReport; Index: port.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/port.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** port.cpp 13 Nov 2008 08:07:40 -0000 1.3 --- port.cpp 24 Nov 2008 12:36:59 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.4 2008/11/24 12:36:59 vfrolov + * Changed plugin API + * * Revision 1.3 2008/11/13 08:07:40 vfrolov * Changed for staticaly linking *************** *** 38,49 **** /////////////////////////////////////////////////////////////// ! Port::Port(ComHub &_hub, int _num, const PORT_ROUTINES_A *pPortRoutines, HPORT _hPort) : hub(_hub), num(_num), ! hPort(_hPort) { #ifdef _DEBUG signature = PORT_SIGNATURE; #endif const char *pName = ROUTINE_IS_VALID(pPortRoutines, pGetPortName) --- 41,81 ---- /////////////////////////////////////////////////////////////// ! Port::Port(ComHub &_hub, int _num) : hub(_hub), num(_num), ! hPort(NULL) { + stringstream buf; + + buf << "P(" << num << ")"; + + name = buf.str(); + #ifdef _DEBUG signature = PORT_SIGNATURE; #endif + } + + BOOL Port::Init( + const PORT_ROUTINES_A *pPortRoutines, + HCONFIG hConfig, + const char *pPath) + { + if (!ROUTINE_IS_VALID(pPortRoutines, pCreate)) { + cerr << "No create routine for port " << pPath << endl; + return FALSE; + } + + hPort = pPortRoutines->pCreate(hConfig, pPath); + + if (!hPort) { + cerr << "Can't create port " << pPath << endl; + return FALSE; + } + + pStart = ROUTINE_GET(pPortRoutines, pStart); + pFakeReadFilter = ROUTINE_GET(pPortRoutines, pFakeReadFilter); + pWrite = ROUTINE_GET(pPortRoutines, pWrite); + pLostReport = ROUTINE_GET(pPortRoutines, pLostReport); const char *pName = ROUTINE_IS_VALID(pPortRoutines, pGetPortName) *************** *** 66,84 **** pPortRoutines->pSetPortName(hPort, name.c_str()); ! pInit = ROUTINE_GET(pPortRoutines, pInit); ! pStart = ROUTINE_GET(pPortRoutines, pStart); ! pFakeReadFilter = ROUTINE_GET(pPortRoutines, pFakeReadFilter); ! pWrite = ROUTINE_GET(pPortRoutines, pWrite); ! pAddXoff = ROUTINE_GET(pPortRoutines, pAddXoff); ! pAddXon = ROUTINE_GET(pPortRoutines, pAddXon); ! pLostReport = ROUTINE_GET(pPortRoutines, pLostReport); ! } ! ! BOOL Port::Init() ! { ! if (!pInit) ! return TRUE; ! return pInit(hPort, HMASTERPORT(this), HHUB(&hub)); } --- 98,107 ---- pPortRoutines->pSetPortName(hPort, name.c_str()); ! if (ROUTINE_IS_VALID(pPortRoutines, pInit)) { ! if (!ROUTINE_GET(pPortRoutines, pInit)(hPort, HMASTERPORT(this))) ! return FALSE; ! } ! return TRUE; } *************** *** 118,133 **** } - void Port::AddXoff() - { - if (pAddXoff) - pAddXoff(hPort); - } - - void Port::AddXon() - { - if (pAddXon) - pAddXon(hPort); - } - void Port::LostReport() { --- 141,144 ---- Index: hubmsg.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/hubmsg.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** hubmsg.cpp 13 Nov 2008 08:07:40 -0000 1.2 --- hubmsg.cpp 24 Nov 2008 12:36:59 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2008/11/24 12:36:59 vfrolov + * Changed plugin API + * * Revision 1.2 2008/11/13 08:07:40 vfrolov * Changed for staticaly linking *************** *** 77,81 **** } ! if ((type & HUB_MSG_UNION_TYPE_MASK) == HUB_MSG_UNION_TYPE_BUF) { BufAppend(&pNewMsg->u.buf.pBuf, 0, u.buf.pBuf, u.buf.size); --- 80,84 ---- } ! if ((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_BUF) { BufAppend(&pNewMsg->u.buf.pBuf, 0, u.buf.pBuf, u.buf.size); *************** *** 98,102 **** _ASSERTE(signature == MSG_SIGNATURE); ! if ((type & HUB_MSG_UNION_TYPE_MASK) == HUB_MSG_UNION_TYPE_BUF) BufFree(u.buf.pBuf); --- 101,105 ---- _ASSERTE(signature == MSG_SIGNATURE); ! if ((type & HUB_MSG_UNION_TYPES_MASK) == HUB_MSG_UNION_TYPE_BUF) BufFree(u.buf.pBuf); Index: route.h =================================================================== RCS file: /cvsroot/com0com/hub4com/route.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** route.h 26 Mar 2008 08:37:06 -0000 1.1 --- route.h 24 Nov 2008 12:36:59 -0000 1.2 *************** *** 20,27 **** * * $Log$ * Revision 1.1 2008/03/26 08:37:06 vfrolov * Initial revision * - * */ --- 20,29 ---- * * $Log$ + * Revision 1.2 2008/11/24 12:36:59 vfrolov + * Changed plugin API + * * Revision 1.1 2008/03/26 08:37:06 vfrolov * Initial revision * */ *************** *** 30,44 **** /////////////////////////////////////////////////////////////// ! typedef multimap<int, int> PortNumMap; /////////////////////////////////////////////////////////////// void AddRoute( ! PortNumMap &map, ! int iFrom, ! int iTo, BOOL noRoute, BOOL noEcho); void SetFlowControlRoute( ! PortNumMap &routeFlowControlMap, ! PortNumMap &routeDataMap, BOOL fromAnyDataReceiver); /////////////////////////////////////////////////////////////// --- 32,48 ---- /////////////////////////////////////////////////////////////// ! class Port; ! /////////////////////////////////////////////////////////////// ! typedef multimap<Port *, Port *> PortMap; /////////////////////////////////////////////////////////////// void AddRoute( ! PortMap &map, ! Port *pFrom, ! Port *pTo, BOOL noRoute, BOOL noEcho); void SetFlowControlRoute( ! PortMap &routeFlowControlMap, ! PortMap &routeDataMap, BOOL fromAnyDataReceiver); /////////////////////////////////////////////////////////////// Index: plugins.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** plugins.cpp 13 Nov 2008 08:07:40 -0000 1.4 --- plugins.cpp 24 Nov 2008 12:36:59 -0000 1.5 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.5 2008/11/24 12:36:59 vfrolov + * Changed plugin API + * * Revision 1.4 2008/11/13 08:07:40 vfrolov * Changed for staticaly linking *************** *** 49,56 **** public: PluginEnt(const PLUGIN_ROUTINES_A *_pRoutines, HMODULE _hDll); - ~PluginEnt(); void Help(const char *pProgPath) const; BOOL Config(const char *pArg) const; #define ABOUT(item) \ --- 52,61 ---- public: PluginEnt(const PLUGIN_ROUTINES_A *_pRoutines, HMODULE _hDll); void Help(const char *pProgPath) const; + + void ConfigStart(); BOOL Config(const char *pArg) const; + void ConfigStop(); #define ABOUT(item) \ *************** *** 93,104 **** hConfig(NULL) { - if (ROUTINE_IS_VALID(pRoutines, pConfigStart)) - hConfig = pRoutines->pConfigStart(); - } - - PluginEnt::~PluginEnt() - { - if (hConfig && ROUTINE_IS_VALID(pRoutines, pConfigStop)) - pRoutines->pConfigStop(hConfig); } --- 98,101 ---- *************** *** 111,114 **** --- 108,117 ---- } + void PluginEnt::ConfigStart() + { + if (ROUTINE_IS_VALID(pRoutines, pConfigStart)) + hConfig = pRoutines->pConfigStart(); + } + BOOL PluginEnt::Config(const char *pArg) const { *************** *** 118,121 **** --- 121,132 ---- return FALSE; } + + void PluginEnt::ConfigStop() + { + if (hConfig && ROUTINE_IS_VALID(pRoutines, pConfigStop)) { + pRoutines->pConfigStop(hConfig); + hConfig = NULL; + } + } /////////////////////////////////////////////////////////////// static string type2str(PLUGIN_TYPE type) *************** *** 416,419 **** --- 427,442 ---- } /////////////////////////////////////////////////////////////// + void Plugins::ConfigStart() const + { + for (TypePluginsMap::const_iterator iPair = plugins.begin() ; iPair != plugins.end() ; iPair++) { + if (iPair->second) { + for (PluginArray::const_iterator i = iPair->second->begin() ; i != iPair->second->end() ; i++) { + if (*i) + (*i)->ConfigStart(); + } + } + } + } + /////////////////////////////////////////////////////////////// BOOL Plugins::Config(const char *pArg) const { *************** *** 432,435 **** --- 455,470 ---- } /////////////////////////////////////////////////////////////// + void Plugins::ConfigStop() const + { + for (TypePluginsMap::const_iterator iPair = plugins.begin() ; iPair != plugins.end() ; iPair++) { + if (iPair->second) { + for (PluginArray::const_iterator i = iPair->second->begin() ; i != iPair->second->end() ; i++) { + if (*i) + (*i)->ConfigStop(); + } + } + } + } + /////////////////////////////////////////////////////////////// const PLUGIN_ROUTINES_A *Plugins::GetRoutines( PLUGIN_TYPE type, Index: comhub.h =================================================================== RCS file: /cvsroot/com0com/hub4com/comhub.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** comhub.h 13 Nov 2008 08:07:40 -0000 1.8 --- comhub.h 24 Nov 2008 12:36:59 -0000 1.9 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.9 2008/11/24 12:36:59 vfrolov + * Changed plugin API + * * Revision 1.8 2008/11/13 08:07:40 vfrolov * Changed for staticaly linking *************** *** 56,60 **** typedef vector<Port*> Ports; typedef multimap<Port*, Port*> PortMap; - typedef multimap<int, int> PortNumMap; /////////////////////////////////////////////////////////////// #define HUB_SIGNATURE 'h4cH' --- 59,62 ---- *************** *** 76,83 **** #endif ! void Add() { ports.push_back(NULL); } ! BOOL CreatePort( ! const PORT_ROUTINES_A *pPortRoutines, int n, HCONFIG hConfig, const char *pPath); --- 78,85 ---- #endif ! void Add(); ! BOOL InitPort( int n, + const PORT_ROUTINES_A *pPortRoutines, HCONFIG hConfig, const char *pPath); *************** *** 85,93 **** BOOL OnFakeRead(Port *pFromPort, HubMsg *pMsg) const; void OnRead(Port *pFromPort, HubMsg *pMsg) const; ! void AddXoff(Port *pFromPort) const; ! void AddXon(Port *pFromPort) const; void LostReport() const; ! void SetDataRoute(const PortNumMap &map); ! void SetFlowControlRoute(const PortNumMap &map); void RouteReport() const; int NumPorts() const { return (int)ports.size(); } --- 87,94 ---- BOOL OnFakeRead(Port *pFromPort, HubMsg *pMsg) const; void OnRead(Port *pFromPort, HubMsg *pMsg) const; ! void AddXoffXon(Port *pFromPort, BOOL xoff) const; void LostReport() const; ! void SetDataRoute(const PortMap &map) { routeDataMap = map; } ! void SetFlowControlRoute(const PortMap &map) { routeFlowControlMap = map; } void RouteReport() const; int NumPorts() const { return (int)ports.size(); } *************** *** 100,106 **** Port *ComHub::GetPort(int n) const { ! if (n < 0 || n >= NumPorts()) ! return NULL; ! return ports.at(n); } --- 101,105 ---- Port *ComHub::GetPort(int n) const { ! _ASSERTE(n >= 0 && n < NumPorts()); return ports.at(n); } *************** *** 109,112 **** --- 108,113 ---- private: + void OnRead(const PortMap &routeMap, Port *pFromPort, HubMsg *pMsg) const; + Ports ports; PortMap routeDataMap; *************** *** 116,119 **** --- 117,121 ---- #ifdef _DEBUG + private: DWORD signature; Index: comhub.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/comhub.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** comhub.cpp 21 Nov 2008 08:16:56 -0000 1.11 --- comhub.cpp 24 Nov 2008 12:36:59 -0000 1.12 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.12 2008/11/24 12:36:59 vfrolov + * Changed plugin API + * * Revision 1.11 2008/11/21 08:16:56 vfrolov * Added HUB_MSG_TYPE_LOOP_TEST *************** *** 71,112 **** /////////////////////////////////////////////////////////////// ! BOOL ComHub::CreatePort( ! const PORT_ROUTINES_A *pPortRoutines, ! int n, ! HCONFIG hConfig, ! const char *pPath) { ! if (!ROUTINE_IS_VALID(pPortRoutines, pCreate)) { ! cerr << "No create routine for port " << pPath << endl; ! return FALSE; ! } ! ! HPORT hPort = pPortRoutines->pCreate(hConfig, pPath); ! if (!hPort) { ! cerr << "Can't create port " << pPath << endl; ! return FALSE; } ! ports[n] = new Port(*this, n, pPortRoutines, hPort); ! ! if (!ports[n]) { ! cerr << "Can't create master port " << pPath << endl; ! return FALSE; ! } ! return TRUE; } BOOL ComHub::StartAll() const { - if (pFilters && !pFilters->Init()) - return FALSE; - - for (Ports::const_iterator i = ports.begin() ; i != ports.end() ; i++) { - if (!(*i)->Init()) - return FALSE; - } - for (Ports::const_iterator i = ports.begin() ; i != ports.end() ; i++) { HubMsg msg; --- 74,100 ---- /////////////////////////////////////////////////////////////// ! void ComHub::Add() { ! Port *pPort = new Port(*this, NumPorts()); ! if (!pPort) { ! cerr << "No enough memory." << endl; ! exit(2); } ! ports.push_back(pPort); ! } ! BOOL ComHub::InitPort( ! int n, ! const PORT_ROUTINES_A *pPortRoutines, ! HCONFIG hConfig, ! const char *pPath) ! { ! return ports[n]->Init(pPortRoutines, hConfig, pPath); } BOOL ComHub::StartAll() const { for (Ports::const_iterator i = ports.begin() ; i != ports.end() ; i++) { HubMsg msg; *************** *** 189,192 **** --- 177,195 ---- void ComHub::OnRead(Port *pFromPort, HubMsg *pMsg) const { + OnRead(routeDataMap, pFromPort, pMsg); + } + + void ComHub::AddXoffXon(Port *pFromPort, BOOL xoff) const + { + HubMsg msg; + + msg.type = HUB_MSG_TYPE_ADD_XOFF_XON; + msg.u.val = xoff; + + OnRead(routeFlowControlMap, pFromPort, &msg); + } + + void ComHub::OnRead(const PortMap &routeMap, Port *pFromPort, HubMsg *pMsg) const + { _ASSERTE(pFromPort != NULL); _ASSERTE(pMsg != NULL); *************** *** 195,199 **** HubMsg *pEchoMsg = NULL; ! if (!pFilters->InMethod(pFromPort->Num(), pMsg, &pEchoMsg)) { if (pEchoMsg) { delete pEchoMsg; --- 198,202 ---- HubMsg *pEchoMsg = NULL; ! if (!pFilters->InMethod(pFromPort, pMsg, &pEchoMsg)) { if (pEchoMsg) { delete pEchoMsg; *************** *** 209,213 **** } ! for (PortMap::const_iterator i = routeDataMap.find(pFromPort) ; i != routeDataMap.end() ; i++) { if (i->first != pFromPort) break; --- 212,216 ---- } ! for (PortMap::const_iterator i = routeMap.find(pFromPort) ; i != routeMap.end() ; i++) { if (i->first != pFromPort) break; *************** *** 216,220 **** if (pFilters && pOutMsg) { ! if (!pFilters->OutMethod(pFromPort->Num(), i->second->Num(), pOutMsg)) { if (pOutMsg) { delete pOutMsg; --- 219,223 ---- if (pFilters && pOutMsg) { ! if (!pFilters->OutMethod(pFromPort, i->second, pOutMsg)) { if (pOutMsg) { delete pOutMsg; *************** *** 232,255 **** } - void ComHub::AddXoff(Port *pFromPort) const - { - for (PortMap::const_iterator i = routeFlowControlMap.find(pFromPort) ; i != routeFlowControlMap.end() ; i++) { - if (i->first != pFromPort) - break; - - i->second->AddXoff(); - } - } - - void ComHub::AddXon(Port *pFromPort) const - { - for (PortMap::const_iterator i = routeFlowControlMap.find(pFromPort) ; i != routeFlowControlMap.end() ; i++) { - if (i->first != pFromPort) - break; - - i->second->AddXon(); - } - } - void ComHub::LostReport() const { --- 235,238 ---- *************** *** 258,277 **** } - void ComHub::SetDataRoute(const PortNumMap &map) - { - routeDataMap.clear(); - - for (PortNumMap::const_iterator i = map.begin() ; i != map.end() ; i++) - routeDataMap.insert(pair<Port*, Port*>(ports.at(i->first), ports.at(i->second))); - } - - void ComHub::SetFlowControlRoute(const PortNumMap &map) - { - routeFlowControlMap.clear(); - - for (PortNumMap::const_iterator i = map.begin() ; i != map.end() ; i++) - routeFlowControlMap.insert(pair<Port*, Port*>(ports.at(i->first), ports.at(i->second))); - } - static void RouteReport(const PortMap &map, const char *pMapName) { --- 241,244 ---- *************** *** 305,312 **** ::RouteReport(routeFlowControlMap, "flow control"); } - - const char *ComHub::FilterName(HFILTER hFilter) const - { - return pFilters ? pFilters->FilterName(hFilter) : NULL; - } /////////////////////////////////////////////////////////////// --- 272,274 ---- Index: route.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/route.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** route.cpp 26 Mar 2008 08:37:06 -0000 1.1 --- route.cpp 24 Nov 2008 12:36:59 -0000 1.2 *************** *** 20,27 **** * * $Log$ * Revision 1.1 2008/03/26 08:37:06 vfrolov * Initial revision * - * */ --- 20,29 ---- * * $Log$ + * Revision 1.2 2008/11/24 12:36:59 vfrolov + * Changed plugin API + * * Revision 1.1 2008/03/26 08:37:06 vfrolov * Initial revision * */ *************** *** 30,38 **** /////////////////////////////////////////////////////////////// ! typedef pair<int, int> PortPair; /////////////////////////////////////////////////////////////// ! static PortNumMap::iterator FindPair(PortNumMap &map, const PortPair &pair) { ! PortNumMap::iterator i; for (i = map.find(pair.first) ; i != map.end() ; i++) { --- 32,40 ---- /////////////////////////////////////////////////////////////// ! typedef pair<Port *, Port *> PortPair; /////////////////////////////////////////////////////////////// ! static PortMap::iterator FindPair(PortMap &map, const PortPair &pair) { ! PortMap::iterator i; for (i = map.find(pair.first) ; i != map.end() ; i++) { *************** *** 48,62 **** void AddRoute( ! PortNumMap &map, ! int iFrom, ! int iTo, BOOL noRoute, BOOL noEcho) { ! if (iFrom != iTo || !noEcho || noRoute) { ! PortPair pair(iFrom, iTo); for (;;) { ! PortNumMap::iterator i = FindPair(map, pair); if (i == map.end()) { --- 50,64 ---- void AddRoute( ! PortMap &map, ! Port *pFrom, ! Port *pTo, BOOL noRoute, BOOL noEcho) { ! if (pFrom != pTo || !noEcho || noRoute) { ! PortPair pair(pFrom, pTo); for (;;) { ! PortMap::iterator i = FindPair(map, pair); if (i == map.end()) { *************** *** 74,84 **** void SetFlowControlRoute( ! PortNumMap &routeFlowControlMap, ! PortNumMap &routeDataMap, BOOL fromAnyDataReceiver) { routeFlowControlMap.clear(); ! for (PortNumMap::const_iterator i = routeDataMap.begin() ; i != routeDataMap.end() ; i++) { PortPair pair(i->second, i->first); --- 76,86 ---- void SetFlowControlRoute( ! PortMap &routeFlowControlMap, ! PortMap &routeDataMap, BOOL fromAnyDataReceiver) { routeFlowControlMap.clear(); ! for (PortMap::const_iterator i = routeDataMap.begin() ; i != routeDataMap.end() ; i++) { PortPair pair(i->second, i->first); Index: filters.h =================================================================== RCS file: /cvsroot/com0com/hub4com/filters.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** filters.h 13 Nov 2008 08:07:40 -0000 1.6 --- filters.h 24 Nov 2008 12:36:59 -0000 1.7 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.7 2008/11/24 12:36:59 vfrolov + * Changed plugin API + * * Revision 1.6 2008/11/13 08:07:40 vfrolov * Changed for staticaly linking *************** *** 51,55 **** typedef vector<Filter*> FilterArray; typedef vector<FilterMethod*> FilterMethodArray; ! typedef map<int, FilterMethodArray*> PortFiltersMap; /////////////////////////////////////////////////////////////// class Filters --- 54,59 ---- typedef vector<Filter*> FilterArray; typedef vector<FilterMethod*> FilterMethodArray; ! typedef map<Port *, FilterMethodArray*> PortFiltersMap; ! typedef set<Port *> SetOfPorts; /////////////////////////////////////////////////////////////// class Filters *************** *** 65,83 **** const char *pArgs); BOOL AddFilter( ! int iPort, const char *pGroup, BOOL addInMethod, BOOL addOutMethod, ! const set<int> *pOutMethodSrcPorts); void Report() const; - BOOL Init() const; - const char *FilterName(HFILTER hFilter) const; BOOL InMethod( ! int nFromPort, HubMsg *pInMsg, HubMsg **ppEchoMsg) const; BOOL OutMethod( ! int nFromPort, ! int nToPort, HubMsg *pOutMsg) const; --- 69,85 ---- const char *pArgs); BOOL AddFilter( ! Port *pPort, const char *pGroup, BOOL addInMethod, BOOL addOutMethod, ! const SetOfPorts *pOutMethodSrcPorts); void Report() const; BOOL InMethod( ! Port *pFromPort, HubMsg *pInMsg, HubMsg **ppEchoMsg) const; BOOL OutMethod( ! Port *pFromPort, ! Port *pToPort, HubMsg *pOutMsg) const; Index: hub4com.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/hub4com.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** hub4com.cpp 13 Nov 2008 08:07:40 -0000 1.17 --- hub4com.cpp 24 Nov 2008 12:36:59 -0000 1.18 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.18 2008/11/24 12:36:59 vfrolov + * Changed plugin API + * * Revision 1.17 2008/11/13 08:07:40 vfrolov * Changed for staticaly linking *************** *** 180,184 **** ComHub &hub, const char *pList, ! BOOL (*pFunc)(ComHub &hub, int iPort, PVOID p0, PVOID p1, PVOID p2), PVOID p0 = NULL, PVOID p1 = NULL, --- 183,187 ---- ComHub &hub, const char *pList, ! BOOL (*pFunc)(ComHub &hub, Port *pPort, PVOID p0, PVOID p1, PVOID p2), PVOID p0 = NULL, PVOID p1 = NULL, *************** *** 200,208 **** if (_stricmp(p, "All") == 0) { for (i = 0 ; i < hub.NumPorts() ; i++) { ! if (!pFunc(hub, i, p0, p1, p2)) res = FALSE; } } else if (StrToInt(p, &i) && i >= 0 && i < hub.NumPorts()) { ! if (!pFunc(hub, i, p0, p1, p2)) res = FALSE; } else { --- 203,211 ---- if (_stricmp(p, "All") == 0) { for (i = 0 ; i < hub.NumPorts() ; i++) { ! if (!pFunc(hub, hub.GetPort(i), p0, p1, p2)) res = FALSE; } } else if (StrToInt(p, &i) && i >= 0 && i < hub.NumPorts()) { ! if (!pFunc(hub, hub.GetPort(i), p0, p1, p2)) res = FALSE; } else { *************** *** 217,227 **** } /////////////////////////////////////////////////////////////// ! static BOOL EchoRoute(ComHub &/*hub*/, int iPort, PVOID pMap, PVOID /*p1*/, PVOID /*p2*/) { ! AddRoute(*(PortNumMap *)pMap, iPort, iPort, FALSE, FALSE); return TRUE; } ! static void EchoRoute(ComHub &hub, const char *pList, PortNumMap &map) { if (!EnumPortList(hub, pList, EchoRoute, &map)) { --- 220,230 ---- } /////////////////////////////////////////////////////////////// ! static BOOL EchoRoute(ComHub &/*hub*/, Port *pPort, PVOID pMap, PVOID /*p1*/, PVOID /*p2*/) { ! AddRoute(*(PortMap *)pMap, pPort, pPort, FALSE, FALSE); return TRUE; } ! static void EchoRoute(ComHub &hub, const char *pList, PortMap &map) { if (!EnumPortList(hub, pList, EchoRoute, &map)) { *************** *** 231,243 **** } /////////////////////////////////////////////////////////////// ! static BOOL Route(ComHub &/*hub*/, int iTo, PVOID pIFrom, PVOID pNoRoute, PVOID pMap) { ! AddRoute(*(PortNumMap *)pMap, *(int *)pIFrom, iTo, *(BOOL *)pNoRoute, TRUE); return TRUE; } ! static BOOL RouteList(ComHub &hub, int iFrom, PVOID pListTo, PVOID pNoRoute, PVOID pMap) { ! return EnumPortList(hub, (const char *)pListTo, Route, &iFrom, pNoRoute, pMap); } --- 234,246 ---- } /////////////////////////////////////////////////////////////// ! static BOOL Route(ComHub &/*hub*/, Port *pTo, PVOID pFrom, PVOID pNoRoute, PVOID pMap) { ! AddRoute(*(PortMap *)pMap, (Port *)pFrom, pTo, *(BOOL *)pNoRoute, TRUE); return TRUE; } ! static BOOL RouteList(ComHub &hub, Port *pFrom, PVOID pListTo, PVOID pNoRoute, PVOID pMap) { ! return EnumPortList(hub, (const char *)pListTo, Route, pFrom, pNoRoute, pMap); } *************** *** 247,251 **** const char *pListTo, BOOL noRoute, ! PortNumMap &map) { return EnumPortList(hub, pListFrom, RouteList, (PVOID)pListTo, &noRoute, &map); --- 250,254 ---- const char *pListTo, BOOL noRoute, ! PortMap &map) { return EnumPortList(hub, pListFrom, RouteList, (PVOID)pListTo, &noRoute, &map); *************** *** 257,261 **** BOOL biDirection, BOOL noRoute, ! PortNumMap &map) { char *pTmp = _strdup(pParam); --- 260,264 ---- BOOL biDirection, BOOL noRoute, ! PortMap &map) { char *pTmp = _strdup(pParam); *************** *** 338,342 **** } /////////////////////////////////////////////////////////////// ! static BOOL AddFilters(ComHub &hub, int iPort, PVOID pFilters, PVOID pListFlt, PVOID /*p2*/) { char *pTmpList = _strdup((const char *)pListFlt); --- 341,345 ---- } /////////////////////////////////////////////////////////////// ! static BOOL AddFilters(ComHub &hub, Port *pPort, PVOID pFilters, PVOID pListFlt, PVOID /*p2*/) { char *pTmpList = _strdup((const char *)pListFlt); *************** *** 358,362 **** char *pList = STRTOK_R(NULL, ")", &pSave2); ! set<int> *pSrcPorts = NULL; if (pList) { --- 361,365 ---- char *pList = STRTOK_R(NULL, ")", &pSave2); ! SetOfPorts *pSrcPorts = NULL; if (pList) { *************** *** 372,376 **** } else if (StrToInt(p, &i) && i >= 0 && i < hub.NumPorts()) { if (!pSrcPorts) { ! pSrcPorts = new set<int>; if (!pSrcPorts) { --- 375,379 ---- } else if (StrToInt(p, &i) && i >= 0 && i < hub.NumPorts()) { if (!pSrcPorts) { ! pSrcPorts = new SetOfPorts; if (!pSrcPorts) { *************** *** 380,384 **** } ! pSrcPorts->insert(i); } else { cerr << "Invalid port " << p << endl; --- 383,387 ---- } ! pSrcPorts->insert(hub.GetPort(i)); } else { cerr << "Invalid port " << p << endl; *************** *** 392,405 **** if (method == ".IN") { ! if (!((Filters *)pFilters)->AddFilter(iPort, filter.substr(0, dot).c_str(), TRUE, FALSE, NULL)) exit(1); } else if (method == ".OUT") { ! if (!((Filters *)pFilters)->AddFilter(iPort, filter.substr(0, dot).c_str(), FALSE, TRUE, pSrcPorts)) exit(1); } else { ! if (!((Filters *)pFilters)->AddFilter(iPort, filter.c_str(), TRUE, TRUE, pSrcPorts)) exit(1); } --- 395,408 ---- if (method == ".IN") { ! if (!((Filters *)pFilters)->AddFilter(pPort, filter.substr(0, dot).c_str(), TRUE, FALSE, NULL)) exit(1); } else if (method == ".OUT") { ! if (!((Filters *)pFilters)->AddFilter(pPort, filter.substr(0, dot).c_str(), FALSE, TRUE, pSrcPorts)) exit(1); } else { ! if (!((Filters *)pFilters)->AddFilter(pPort, filter.c_str(), TRUE, TRUE, pSrcPorts)) exit(1); } *************** *** 459,466 **** } Filters *pFilters = NULL; ! PortNumMap routeDataMap; ! PortNumMap routeFlowControlMap; const char *pUseDriver = "serial"; --- 462,471 ---- } + pPlugins->ConfigStart(); + Filters *pFilters = NULL; ! PortMap routeDataMap; ! PortMap routeFlowControlMap; const char *pUseDriver = "serial"; *************** *** 481,485 **** } ! if (!hub.CreatePort(pPortRoutines, plugged++, hConfig, i->c_str())) exit(1); --- 486,490 ---- } ! if (!hub.InitPort(plugged++, pPortRoutines, hConfig, i->c_str())) exit(1); *************** *** 559,562 **** --- 564,568 ---- } + pPlugins->ConfigStop(); delete pPlugins; Index: plugins.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** plugins.h 13 Nov 2008 08:07:40 -0000 1.2 --- plugins.h 24 Nov 2008 12:36:59 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2008/11/24 12:36:59 vfrolov + * Changed plugin API + * * Revision 1.2 2008/11/13 08:07:40 vfrolov * Changed for staticaly linking *************** *** 48,52 **** --- 51,57 ---- void Help(const char *pProgPath, const char *pPluginName) const; + void ConfigStart() const; BOOL Config(const char *pArg) const; + void ConfigStop() const; const PLUGIN_ROUTINES_A *GetRoutines( Index: filters.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/filters.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** filters.cpp 13 Nov 2008 08:07:40 -0000 1.6 --- filters.cpp 24 Nov 2008 12:36:59 -0000 1.7 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.7 2008/11/24 12:36:59 vfrolov + * Changed plugin API + * * Revision 1.6 2008/11/13 08:07:40 vfrolov * Changed for staticaly linking *************** *** 46,49 **** --- 49,53 ---- #include "comhub.h" #include "filters.h" + #include "filter.h" #include "bufutils.h" #include "hubmsg.h" *************** *** 51,81 **** /////////////////////////////////////////////////////////////// - class Filter { - public: - Filter( - const char *pGroup, - const char *pName, - HFILTER _hFilter, - FILTER_INIT *_pInit, - FILTER_IN_METHOD *_pInMethod, - FILTER_OUT_METHOD *_pOutMethod) - : group(pGroup), - name(pName), - hFilter(_hFilter), - pInit(_pInit), - pInMethod(_pInMethod), - pOutMethod(_pOutMethod) {} - - const string group; - const string name; - const HFILTER hFilter; - FILTER_INIT *const pInit; - FILTER_IN_METHOD *const pInMethod; - FILTER_OUT_METHOD *const pOutMethod; - }; - /////////////////////////////////////////////////////////////// class FilterMethod { public: ! FilterMethod(const Filter &_filter, BOOL _isInMethod, const set<int> *_pSrcPorts) : filter(_filter), isInMethod(_isInMethod), --- 55,61 ---- /////////////////////////////////////////////////////////////// class FilterMethod { public: ! FilterMethod(const Filter &_filter, BOOL _isInMethod, const SetOfPorts *_pSrcPorts) : filter(_filter), isInMethod(_isInMethod), *************** *** 89,96 **** const Filter &filter; const BOOL isInMethod; ! const set<int> *const pSrcPorts; }; /////////////////////////////////////////////////////////////// ! typedef pair<int, FilterMethodArray*> PortFilters; /////////////////////////////////////////////////////////////// Filters::~Filters() --- 69,76 ---- const Filter &filter; const BOOL isInMethod; ! const SetOfPorts *const pSrcPorts; }; /////////////////////////////////////////////////////////////// ! typedef pair<Port *, FilterMethodArray*> PortFilters; /////////////////////////////////////////////////////////////// Filters::~Filters() *************** *** 143,147 **** pFilterName, hFilter, - ROUTINE_GET(pFltRoutines, pInit), ROUTINE_GET(pFltRoutines, pInMethod), ROUTINE_GET(pFltRoutines, pOutMethod)); --- 123,126 ---- *************** *** 154,176 **** allFilters.push_back(pFilter); return TRUE; } /////////////////////////////////////////////////////////////// BOOL Filters::AddFilter( ! int iPort, const char *pGroup, BOOL addInMethod, BOOL addOutMethod, ! const set<int> *pOutMethodSrcPorts) { ! PortFiltersMap::iterator iPair = portFilters.find(iPort); if (iPair == portFilters.end()) { ! portFilters.insert(PortFilters(iPort, NULL)); ! iPair = portFilters.find(iPort); if (iPair == portFilters.end()) { ! cerr << "Can't add filters for port " << iPort << endl; return FALSE; } --- 133,160 ---- allFilters.push_back(pFilter); + if (ROUTINE_IS_VALID(pFltRoutines, pInit)) { + if (!ROUTINE_GET(pFltRoutines, pInit)(hFilter, HMASTERFILTER(pFilter))) + return FALSE; + } + return TRUE; } /////////////////////////////////////////////////////////////// BOOL Filters::AddFilter( ! Port *pPort, const char *pGroup, BOOL addInMethod, BOOL addOutMethod, ! const SetOfPorts *pOutMethodSrcPorts) { ! PortFiltersMap::iterator iPair = portFilters.find(pPort); if (iPair == portFilters.end()) { ! portFilters.insert(PortFilters(pPort, NULL)); ! iPair = portFilters.find(pPort); if (iPair == portFilters.end()) { ! cerr << "Can't add filters for port " << pPort->Name() << endl; return FALSE; } *************** *** 202,209 **** if (addOutMethod && (*i)->pOutMethod) { ! const set<int> *pSrcPorts; if (pOutMethodSrcPorts) { ! pSrcPorts = new set<int>(*pOutMethodSrcPorts); if (!pSrcPorts) { --- 186,193 ---- if (addOutMethod && (*i)->pOutMethod) { ! const SetOfPorts *pSrcPorts; if (pOutMethodSrcPorts) { ! pSrcPorts = new SetOfPorts(*pOutMethodSrcPorts); if (!pSrcPorts) { *************** *** 247,251 **** stringstream bufs[3]; ! Port *pPort = hub.GetPort(iPort->first); if (pPort) --- 231,235 ---- stringstream bufs[3]; ! Port *pPort = iPort->first; if (pPort) *************** *** 289,293 **** if ((*i)->pSrcPorts) { bufs[2] << "("; ! for (set<int>::const_iterator iSrc = (*i)->pSrcPorts->begin() ; iSrc != (*i)->pSrcPorts->end() ; iSrc++) { --- 273,277 ---- if ((*i)->pSrcPorts) { bufs[2] << "("; ! for (SetOfPorts::const_iterator iSrc = (*i)->pSrcPorts->begin() ; iSrc != (*i)->pSrcPorts->end() ; iSrc++) { *************** *** 335,364 **** } /////////////////////////////////////////////////////////////// - BOOL Filters::Init() const - { - BOOL res = TRUE; - - for (FilterArray::const_iterator i = allFilters.begin() ; i != allFilters.end() ; i++) { - if (*i && (*i)->pInit) { - if (!(*i)->pInit((*i)->hFilter, (HHUB)&hub)) - res = FALSE; - } - } - - return res; - } - /////////////////////////////////////////////////////////////// - const char *Filters::FilterName(HFILTER hFilter) const - { - for (FilterArray::const_iterator i = allFilters.begin() ; i != allFilters.end() ; i++) { - if (*i && (*i)->hFilter == hFilter) - return (*i)->name.c_str(); - } - - return NULL; - } - /////////////////////////////////////////////////////////////// static BOOL InMethod( ! int nFromPort, const FilterMethodArray::const_iterator &i, const FilterMethodArray::const_iterator &iEnd, --- 319,324 ---- } /////////////////////////////////////////////////////////////// static BOOL InMethod( ! Port *pFromPort, const FilterMethodArray::const_iterator &i, const FilterMethodArray::const_iterator &iEnd, *************** *** 381,385 **** HUB_MSG *pEchoMsgPart = NULL; ! if (!pInMethod(hFilter, nFromPort, pCurMsg, &pEchoMsgPart)) { if (pEchoMsgPart) delete (HubMsg *)pEchoMsgPart; --- 341,345 ---- HUB_MSG *pEchoMsgPart = NULL; ! if (!pInMethod(hFilter, (HMASTERPORT)pFromPort, pCurMsg, &pEchoMsgPart)) { if (pEchoMsgPart) delete (HubMsg *)pEchoMsgPart; *************** *** 400,404 **** if (iNext != iEnd) { ! if (!InMethod(nFromPort, iNext, iEnd, pInMsg, ppEchoMsg)) return FALSE; } --- 360,364 ---- if (iNext != iEnd) { ! if (!InMethod(pFromPort, iNext, iEnd, pInMsg, ppEchoMsg)) return FALSE; } *************** *** 420,424 **** pNextMsg = pNextMsg->Next(); ! if (!pOutMethod(hFilter, nFromPort, nFromPort, pCurMsg)) return FALSE; } --- 380,384 ---- pNextMsg = pNextMsg->Next(); ! if (!pOutMethod(hFilter, (HMASTERPORT)pFromPort, (HMASTERPORT)pFromPort, pCurMsg)) return FALSE; } *************** *** 429,433 **** /////////////////////////////////////////////////////////////// BOOL Filters::InMethod( ! int nFromPort, HubMsg *pInMsg, HubMsg **ppEchoMsg) const --- 389,393 ---- /////////////////////////////////////////////////////////////// BOOL Filters::InMethod( ! Port *pFromPort, HubMsg *pInMsg, HubMsg **ppEchoMsg) const *************** *** 435,439 **** _ASSERTE(*ppEchoMsg == NULL); ! PortFiltersMap::const_iterator iPair = portFilters.find(nFromPort); if (iPair == portFilters.end()) --- 395,399 ---- _ASSERTE(*ppEchoMsg == NULL); ! PortFiltersMap::const_iterator iPair = portFilters.find(pFromPort); if (iPair == portFilters.end()) *************** *** 448,452 **** if (i != pFilters->end()) { ! if (!::InMethod(nFromPort, i, pFilters->end(), pInMsg, ppEchoMsg)) return FALSE; } --- 408,412 ---- if (i != pFilters->end()) { ! if (!::InMethod(pFromPort, i, pFilters->end(), pInMsg, ppEchoMsg)) return FALSE; } *************** *** 456,464 **** /////////////////////////////////////////////////////////////// BOOL Filters::OutMethod( ! int nFromPort, ! int nToPort, HubMsg *pOutMsg) const { ! PortFiltersMap::const_iterator iPair = portFilters.find(nToPort); if (iPair == portFilters.end()) --- 416,424 ---- /////////////////////////////////////////////////////////////// BOOL Filters::OutMethod( ! Port *pFromPort, ! Port *pToPort, HubMsg *pOutMsg) const { ! PortFiltersMap::const_iterator iPair = portFilters.find(pToPort); if (iPair == portFilters.end()) *************** *** 472,476 **** for (FilterMethodArray::const_reverse_iterator i = pFilters->rbegin() ; i != pFilters->rend() ; i++) { if (!(*i)->isInMethod && (!(*i)->pSrcPorts || ! (*i)->pSrcPorts->find(nFromPort) != (*i)->pSrcPorts->end())) { FILTER_OUT_METHOD *pOutMethod = (*i)->filter.pOutMethod; --- 432,436 ---- for (FilterMethodArray::const_reverse_iterator i = pFilters->rbegin() ; i != pFilters->rend() ; i++) { if (!(*i)->isInMethod && (!(*i)->pSrcPorts || ! (*i)->pSrcPorts->find(pFromPort) != (*i)->pSrcPorts->end())) { FILTER_OUT_METHOD *pOutMethod = (*i)->filter.pOutMethod; *************** *** 482,486 **** pNextMsg = pNextMsg->Next(); ! if (!pOutMethod(hFilter, nFromPort, nToPort, pCurMsg)) return FALSE; } --- 442,446 ---- pNextMsg = pNextMsg->Next(); ! if (!pOutMethod(hFilter, (HMASTERPORT)pFromPort, (HMASTERPORT)pToPort, pCurMsg)) return FALSE; } |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 12:37:12
|
Update of /cvsroot/com0com/hub4com/plugins/escinsert In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31238/plugins/escinsert Modified Files: filter.cpp Log Message: Changed plugin API Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/escinsert/filter.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** filter.cpp 13 Nov 2008 07:46:58 -0000 1.5 --- filter.cpp 24 Nov 2008 12:37:00 -0000 1.6 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.6 2008/11/24 12:37:00 vfrolov + * Changed plugin API + * * Revision 1.5 2008/11/13 07:46:58 vfrolov * Changed for staticaly linking *************** *** 86,90 **** public: Filter(int argc, const char *const argv[]); ! State *GetState(int nPort); DWORD soMask; --- 89,93 ---- public: Filter(int argc, const char *const argv[]); ! State *GetState(HMASTERPORT hPort); DWORD soMask; *************** *** 92,97 **** private: ! typedef map<int, State*> PortsMap; ! typedef pair<int, State*> PortPair; PortsMap portsMap; --- 95,100 ---- private: ! typedef map<HMASTERPORT, State*> PortsMap; ! typedef pair<HMASTERPORT, State*> PortPair; PortsMap portsMap; *************** *** 120,131 **** } ! State *Filter::GetState(int nPort) { ! PortsMap::iterator iPair = portsMap.find(nPort); if (iPair == portsMap.end()) { ! portsMap.insert(PortPair(nPort, NULL)); ! iPair = portsMap.find(nPort); if (iPair == portsMap.end()) --- 123,134 ---- } ! State *Filter::GetState(HMASTERPORT hPort) { ! PortsMap::iterator iPair = portsMap.find(hPort); if (iPair == portsMap.end()) { ! portsMap.insert(PortPair(hPort, NULL)); ! iPair = portsMap.find(hPort); if (iPair == portsMap.end()) *************** *** 257,261 **** static BOOL CALLBACK InMethod( HFILTER hFilter, ! int nFromPort, HUB_MSG *pInMsg, HUB_MSG **ppEchoMsg) --- 260,264 ---- static BOOL CALLBACK InMethod( HFILTER hFilter, ! HMASTERPORT hFromPort, HUB_MSG *pInMsg, HUB_MSG **ppEchoMsg) *************** *** 268,272 **** switch (pInMsg->type) { case HUB_MSG_TYPE_CONNECT: { ! State *pState = ((Filter *)hFilter)->GetState(nFromPort); if (!pState) --- 271,275 ---- switch (pInMsg->type) { case HUB_MSG_TYPE_CONNECT: { ! State *pState = ((Filter *)hFilter)->GetState(hFromPort); if (!pState) *************** *** 311,316 **** static BOOL CALLBACK OutMethod( HFILTER hFilter, ! int /*nFromPort*/, ! int nToPort, HUB_MSG *pOutMsg) { --- 314,319 ---- static BOOL CALLBACK OutMethod( HFILTER hFilter, ! HMASTERPORT /*nFromPort*/, ! HMASTERPORT hToPort, HUB_MSG *pOutMsg) { *************** *** 325,329 **** pOutMsg->u.val &= ~((Filter *)hFilter)->soMask; ! State *pState = ((Filter *)hFilter)->GetState(nToPort); if (!pState) --- 328,332 ---- pOutMsg->u.val &= ~((Filter *)hFilter)->soMask; ! State *pState = ((Filter *)hFilter)->GetState(hToPort); if (!pState) *************** *** 335,339 **** } case HUB_MSG_TYPE_SET_BR: { ! State *pState = ((Filter *)hFilter)->GetState(nToPort); if (!pState) --- 338,342 ---- } case HUB_MSG_TYPE_SET_BR: { ! State *pState = ((Filter *)hFilter)->GetState(hToPort); if (!pState) *************** *** 364,368 **** |VAL2LC_STOPBITS(-1)|LC_MASK_STOPBITS)) == 0); ! State *pState = ((Filter *)hFilter)->GetState(nToPort); if (!pState) --- 367,371 ---- |VAL2LC_STOPBITS(-1)|LC_MASK_STOPBITS)) == 0); ! State *pState = ((Filter *)hFilter)->GetState(hToPort); if (!pState) *************** *** 404,408 **** } case HUB_MSG_TYPE_SET_PIN_STATE: { ! State *pState = ((Filter *)hFilter)->GetState(nToPort); if (!pState) --- 407,411 ---- } case HUB_MSG_TYPE_SET_PIN_STATE: { ! State *pState = ((Filter *)hFilter)->GetState(hToPort); if (!pState) *************** *** 443,447 **** } case HUB_MSG_TYPE_SET_LSR: { ! State *pState = ((Filter *)hFilter)->GetState(nToPort); if (!pState) --- 446,450 ---- } case HUB_MSG_TYPE_SET_LSR: { ! State *pState = ((Filter *)hFilter)->GetState(hToPort); if (!pState) |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 12:37:07
|
Update of /cvsroot/com0com/hub4com/plugins/trace In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31238/plugins/trace Modified Files: filter.cpp Log Message: Changed plugin API Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/trace/filter.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** filter.cpp 21 Nov 2008 08:16:56 -0000 1.9 --- filter.cpp 24 Nov 2008 12:37:00 -0000 1.10 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.10 2008/11/24 12:37:00 vfrolov + * Changed plugin API + * * Revision 1.9 2008/11/21 08:16:56 vfrolov * Added HUB_MSG_TYPE_LOOP_TEST *************** *** 147,157 **** public: Filter(TraceConfig &config, int argc, const char *const argv[]); ! void SetHub(HHUB _hHub) { hHub = _hHub; pName = pFilterName(hHub, (HFILTER)this); } ! const char *PortName(int nPort) const { return pPortName(hHub, nPort); } const char *FilterName() const { return pName; } ostream *pTraceStream; private: - HHUB hHub; const char *pName; }; --- 150,160 ---- public: Filter(TraceConfig &config, int argc, const char *const argv[]); ! ! void SetFilterName(const char *_pName) { pName = _pName; } const char *FilterName() const { return pName; } ostream *pTraceStream; + private: const char *pName; }; *************** *** 159,163 **** Filter::Filter(TraceConfig &config, int argc, const char *const argv[]) : pTraceStream(NULL), - hHub(NULL), pName(NULL) { --- 162,165 ---- *************** *** 314,323 **** static BOOL CALLBACK Init( HFILTER hFilter, ! HHUB hHub) { _ASSERTE(hFilter != NULL); ! _ASSERTE(hHub != NULL); ! ((Filter *)hFilter)->SetHub(hHub); return TRUE; --- 316,325 ---- static BOOL CALLBACK Init( HFILTER hFilter, ! HMASTERFILTER hMasterFilter) { _ASSERTE(hFilter != NULL); ! _ASSERTE(hMasterFilter != NULL); ! ((Filter *)hFilter)->SetFilterName(pFilterName(hMasterFilter)); return TRUE; *************** *** 430,433 **** --- 432,436 ---- TOCODE2NAME(HUB_MSG_TYPE_, LLC_STATUS), TOCODE2NAME(HUB_MSG_TYPE_, LOOP_TEST), + TOCODE2NAME(HUB_MSG_TYPE_, ADD_XOFF_XON), {0, NULL} }; *************** *** 616,620 **** static void PrintMsgBody(ostream &tout, HUB_MSG *pMsg) { ! switch (pMsg->type & HUB_MSG_UNION_TYPE_MASK) { case HUB_MSG_UNION_TYPE_NONE: break; --- 619,623 ---- static void PrintMsgBody(ostream &tout, HUB_MSG *pMsg) { ! switch (pMsg->type & HUB_MSG_UNION_TYPES_MASK) { case HUB_MSG_UNION_TYPE_NONE: break; *************** *** 700,704 **** static BOOL CALLBACK InMethod( HFILTER hFilter, ! int nFromPort, HUB_MSG *pInMsg, HUB_MSG **DEBUG_PARAM(ppEchoMsg)) --- 703,707 ---- static BOOL CALLBACK InMethod( HFILTER hFilter, ! HMASTERPORT hFromPort, HUB_MSG *pInMsg, HUB_MSG **DEBUG_PARAM(ppEchoMsg)) *************** *** 714,718 **** PrintTime(tout); ! tout << ((Filter *)hFilter)->PortName(nFromPort) << "-(" << ((Filter *)hFilter)->FilterName() << ")->: "; --- 717,721 ---- PrintTime(tout); ! tout << pPortName(hFromPort) << "-(" << ((Filter *)hFilter)->FilterName() << ")->: "; *************** *** 724,729 **** static BOOL CALLBACK OutMethod( HFILTER hFilter, ! int nFromPort, ! int nToPort, HUB_MSG *pOutMsg) { --- 727,732 ---- static BOOL CALLBACK OutMethod( HFILTER hFilter, ! HMASTERPORT hFromPort, ! HMASTERPORT hToPort, HUB_MSG *pOutMsg) { *************** *** 736,742 **** PrintTime(tout); ! tout << ((Filter *)hFilter)->PortName(nToPort) << "<-(" << ((Filter *)hFilter)->FilterName() << ")-" ! << ((Filter *)hFilter)->PortName(nFromPort) << ": "; PrintMsg(tout, pOutMsg); --- 739,745 ---- PrintTime(tout); ! tout << pPortName(hToPort) << "<-(" << ((Filter *)hFilter)->FilterName() << ")-" ! << pPortName(hFromPort) << ": "; PrintMsg(tout, pOutMsg); |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 12:37:06
|
Update of /cvsroot/com0com/hub4com/plugins/lsrmap In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31238/plugins/lsrmap Modified Files: filter.cpp Log Message: Changed plugin API Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/lsrmap/filter.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** filter.cpp 13 Nov 2008 07:49:45 -0000 1.2 --- filter.cpp 24 Nov 2008 12:37:00 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2008/11/24 12:37:00 vfrolov + * Changed plugin API + * * Revision 1.2 2008/11/13 07:49:45 vfrolov * Changed for staticaly linking *************** *** 59,75 **** public: Filter(int argc, const char *const argv[]); ! void SetHub(HHUB _hHub) { hHub = _hHub; } ! const char *PortName(int nPort) const { return pPortName(hHub, nPort); } ! const char *FilterName() const { return pFilterName(hHub, (HFILTER)this); } BYTE lsrMask; private: ! HHUB hHub; }; Filter::Filter(int argc, const char *const argv[]) : lsrMask(LINE_STATUS_OE|LINE_STATUS_PE|LINE_STATUS_FE|LINE_STATUS_BI|LINE_STATUS_FIFOERR), ! hHub(NULL) { for (const char *const *pArgs = &argv[1] ; argc > 1 ; pArgs++, argc--) { --- 62,78 ---- public: Filter(int argc, const char *const argv[]); ! ! void SetFilterName(const char *_pName) { pName = _pName; } ! const char *FilterName() const { return pName; } BYTE lsrMask; private: ! const char *pName; }; Filter::Filter(int argc, const char *const argv[]) : lsrMask(LINE_STATUS_OE|LINE_STATUS_PE|LINE_STATUS_FE|LINE_STATUS_BI|LINE_STATUS_FIFOERR), ! pName(NULL) { for (const char *const *pArgs = &argv[1] ; argc > 1 ; pArgs++, argc--) { *************** *** 139,148 **** static BOOL CALLBACK Init( HFILTER hFilter, ! HHUB hHub) { _ASSERTE(hFilter != NULL); ! _ASSERTE(hHub != NULL); ! ((Filter *)hFilter)->SetHub(hHub); return TRUE; --- 142,151 ---- static BOOL CALLBACK Init( HFILTER hFilter, ! HMASTERFILTER hMasterFilter) { _ASSERTE(hFilter != NULL); ! _ASSERTE(hMasterFilter != NULL); ! ((Filter *)hFilter)->SetFilterName(pFilterName(hMasterFilter)); return TRUE; *************** *** 151,156 **** static BOOL CALLBACK OutMethod( HFILTER hFilter, ! int nFromPort, ! int nToPort, HUB_MSG *pOutMsg) { --- 154,159 ---- static BOOL CALLBACK OutMethod( HFILTER hFilter, ! HMASTERPORT hFromPort, ! HMASTERPORT hToPort, HUB_MSG *pOutMsg) { *************** *** 175,181 **** if (fail_options) { ! cerr << ((Filter *)hFilter)->PortName(nFromPort) << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() ! << " for port " << ((Filter *)hFilter)->PortName(nToPort) << " option(s) 0x" << hex << fail_options << dec << " not accepted" << endl; --- 178,184 ---- if (fail_options) { ! cerr << pPortName(hFromPort) << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() ! << " for port " << pPortName(hToPort) << " option(s) 0x" << hex << fail_options << dec << " not accepted" << endl; |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 12:37:06
|
Update of /cvsroot/com0com/hub4com/plugins/echo In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31238/plugins/echo Modified Files: filter.cpp Log Message: Changed plugin API Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/echo/filter.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** filter.cpp 13 Nov 2008 07:45:58 -0000 1.3 --- filter.cpp 24 Nov 2008 12:36:59 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.4 2008/11/24 12:36:59 vfrolov + * Changed plugin API + * * Revision 1.3 2008/11/13 07:45:58 vfrolov * Changed for staticaly linking *************** *** 100,104 **** static BOOL CALLBACK InMethod( HFILTER DEBUG_PARAM(hFilter), ! int /*nFromPort*/, HUB_MSG *pInMsg, HUB_MSG **ppEchoMsg) --- 103,107 ---- static BOOL CALLBACK InMethod( HFILTER DEBUG_PARAM(hFilter), ! HMASTERPORT /*nFromPort*/, HUB_MSG *pInMsg, HUB_MSG **ppEchoMsg) |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 12:37:06
|
Update of /cvsroot/com0com/hub4com/plugins/escparse In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31238/plugins/escparse Modified Files: filter.cpp Log Message: Changed plugin API Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/escparse/filter.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** filter.cpp 13 Nov 2008 07:47:48 -0000 1.6 --- filter.cpp 24 Nov 2008 12:37:00 -0000 1.7 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.7 2008/11/24 12:37:00 vfrolov + * Changed plugin API + * * Revision 1.6 2008/11/13 07:47:48 vfrolov * Changed for staticaly linking *************** *** 317,324 **** public: Filter(int argc, const char *const argv[]); ! void SetHub(HHUB _hHub) { hHub = _hHub; } ! EscParse *GetEscParse(int nPort); ! const char *PortName(int nPort) const { return pPortName(hHub, nPort); } ! const char *FilterName() const { return pFilterName(hHub, (HFILTER)this); } BOOL requestEscMode; --- 320,327 ---- public: Filter(int argc, const char *const argv[]); ! EscParse *GetEscParse(HMASTERPORT hPort); ! ! void SetFilterName(const char *_pName) { pName = _pName; } ! const char *FilterName() const { return pName; } BOOL requestEscMode; *************** *** 327,334 **** private: ! HHUB hHub; ! typedef map<int, EscParse*> PortsMap; ! typedef pair<int, EscParse*> PortPair; PortsMap portsMap; --- 330,337 ---- private: ! const char *pName; ! typedef map<HMASTERPORT, EscParse*> PortsMap; ! typedef pair<HMASTERPORT, EscParse*> PortPair; PortsMap portsMap; *************** *** 344,348 **** GO_V2O_MODEM_STATUS(-1) | GO_V2O_LINE_STATUS(-1)), ! hHub(NULL) { for (const char *const *pArgs = &argv[1] ; argc > 1 ; pArgs++, argc--) { --- 347,351 ---- GO_V2O_MODEM_STATUS(-1) | GO_V2O_LINE_STATUS(-1)), ! pName(NULL) { for (const char *const *pArgs = &argv[1] ; argc > 1 ; pArgs++, argc--) { *************** *** 376,387 **** } ! EscParse *Filter::GetEscParse(int nPort) { ! PortsMap::iterator iPair = portsMap.find(nPort); if (iPair == portsMap.end()) { ! portsMap.insert(PortPair(nPort, NULL)); ! iPair = portsMap.find(nPort); if (iPair == portsMap.end()) --- 379,390 ---- } ! EscParse *Filter::GetEscParse(HMASTERPORT hPort) { ! PortsMap::iterator iPair = portsMap.find(hPort); if (iPair == portsMap.end()) { ! portsMap.insert(PortPair(hPort, NULL)); ! iPair = portsMap.find(hPort); if (iPair == portsMap.end()) *************** *** 455,464 **** static BOOL CALLBACK Init( HFILTER hFilter, ! HHUB hHub) { _ASSERTE(hFilter != NULL); ! _ASSERTE(hHub != NULL); ! ((Filter *)hFilter)->SetHub(hHub); return TRUE; --- 458,467 ---- static BOOL CALLBACK Init( HFILTER hFilter, ! HMASTERFILTER hMasterFilter) { _ASSERTE(hFilter != NULL); ! _ASSERTE(hMasterFilter != NULL); ! ((Filter *)hFilter)->SetFilterName(pFilterName(hMasterFilter)); return TRUE; *************** *** 467,471 **** static BOOL CALLBACK InMethod( HFILTER hFilter, ! int nFromPort, HUB_MSG *pInMsg, HUB_MSG ** DEBUG_PARAM(ppEchoMsg)) --- 470,474 ---- static BOOL CALLBACK InMethod( HFILTER hFilter, ! HMASTERPORT hFromPort, HUB_MSG *pInMsg, HUB_MSG ** DEBUG_PARAM(ppEchoMsg)) *************** *** 487,491 **** break; case HUB_MSG_TYPE_GET_IN_OPTS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(nFromPort); if (!pEscParse) --- 490,494 ---- break; case HUB_MSG_TYPE_GET_IN_OPTS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); if (!pEscParse) *************** *** 523,527 **** } case HUB_MSG_TYPE_GET_ESC_OPTS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(nFromPort); if (!pEscParse) --- 526,530 ---- } case HUB_MSG_TYPE_GET_ESC_OPTS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); if (!pEscParse) *************** *** 538,542 **** } case HUB_MSG_TYPE_FAIL_ESC_OPTS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(nFromPort); if (!pEscParse) --- 541,545 ---- } case HUB_MSG_TYPE_FAIL_ESC_OPTS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); if (!pEscParse) *************** *** 546,550 **** if (fail_options) { ! cerr << ((Filter *)hFilter)->PortName(nFromPort) << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() << " escape mode option(s) 0x" << hex << fail_options << dec --- 549,553 ---- if (fail_options) { ! cerr << pPortName(hFromPort) << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() << " escape mode option(s) 0x" << hex << fail_options << dec *************** *** 562,566 **** } case HUB_MSG_TYPE_FAIL_IN_OPTS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(nFromPort); if (!pEscParse) --- 565,569 ---- } case HUB_MSG_TYPE_FAIL_IN_OPTS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); if (!pEscParse) *************** *** 568,572 **** if ((pInMsg->u.val & GO_ESCAPE_MODE) && ((Filter *)hFilter)->requestEscMode) { ! cerr << ((Filter *)hFilter)->PortName(nFromPort) << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() << " option ESCAPE_MODE not accepted" << endl; --- 571,575 ---- if ((pInMsg->u.val & GO_ESCAPE_MODE) && ((Filter *)hFilter)->requestEscMode) { ! cerr << pPortName(hFromPort) << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() << " option ESCAPE_MODE not accepted" << endl; *************** *** 586,590 **** return TRUE; ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(nFromPort); if (!pEscParse) --- 589,593 ---- return TRUE; ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); if (!pEscParse) *************** *** 596,600 **** } case HUB_MSG_TYPE_MODEM_STATUS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(nFromPort); if (!pEscParse) --- 599,603 ---- } case HUB_MSG_TYPE_MODEM_STATUS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); if (!pEscParse) *************** *** 606,610 **** } case HUB_MSG_TYPE_LINE_STATUS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(nFromPort); if (!pEscParse) --- 609,613 ---- } case HUB_MSG_TYPE_LINE_STATUS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); if (!pEscParse) *************** *** 616,620 **** } case HUB_MSG_TYPE_RBR_STATUS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(nFromPort); if (!pEscParse) --- 619,623 ---- } case HUB_MSG_TYPE_RBR_STATUS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); if (!pEscParse) *************** *** 629,633 **** } case HUB_MSG_TYPE_RLC_STATUS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(nFromPort); if (!pEscParse) --- 632,636 ---- } case HUB_MSG_TYPE_RLC_STATUS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); if (!pEscParse) *************** *** 642,646 **** } case HUB_MSG_TYPE_BREAK_STATUS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(nFromPort); if (!pEscParse) --- 645,649 ---- } case HUB_MSG_TYPE_BREAK_STATUS: { ! EscParse *pEscParse = ((Filter *)hFilter)->GetEscParse(hFromPort); if (!pEscParse) |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 12:37:05
|
Update of /cvsroot/com0com/hub4com/plugins/pin2con In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31238/plugins/pin2con Modified Files: filter.cpp Log Message: Changed plugin API Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/pin2con/filter.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** filter.cpp 13 Nov 2008 07:50:41 -0000 1.11 --- filter.cpp 24 Nov 2008 12:37:00 -0000 1.12 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.12 2008/11/24 12:37:00 vfrolov + * Changed plugin API + * * Revision 1.11 2008/11/13 07:50:41 vfrolov * Changed for staticaly linking *************** *** 71,74 **** --- 74,83 ---- namespace FilterPin2Con { /////////////////////////////////////////////////////////////// + #ifndef _DEBUG + #define DEBUG_PARAM(par) + #else /* _DEBUG */ + #define DEBUG_PARAM(par) par + #endif /* _DEBUG */ + /////////////////////////////////////////////////////////////// static ROUTINE_MSG_INSERT_VAL *pMsgInsertVal = NULL; static ROUTINE_MSG_REPLACE_NONE *pMsgReplaceNone = NULL; *************** *** 96,103 **** public: Filter(int argc, const char *const argv[]); ! void SetHub(HHUB _hHub) { hHub = _hHub; } ! State *GetState(int nPort); ! const char *PortName(int nPort) const { return pPortName(hHub, nPort); } ! const char *FilterName() const { return pFilterName(hHub, (HFILTER)this); } DWORD pin; --- 105,112 ---- public: Filter(int argc, const char *const argv[]); ! State *GetState(HMASTERPORT hPort); ! ! void SetFilterName(const char *_pName) { pName = _pName; } ! const char *FilterName() const { return pName; } DWORD pin; *************** *** 105,112 **** private: ! HHUB hHub; ! typedef map<int, State*> PortsMap; ! typedef pair<int, State*> PortPair; PortsMap portsMap; --- 114,121 ---- private: ! const char *pName; ! typedef map<HMASTERPORT, State*> PortsMap; ! typedef pair<HMASTERPORT, State*> PortPair; PortsMap portsMap; *************** *** 127,131 **** : pin(GO_V2O_MODEM_STATUS(MODEM_STATUS_DSR)), negative(FALSE), ! hHub(NULL) { for (const char *const *pArgs = &argv[1] ; argc > 1 ; pArgs++, argc--) { --- 136,140 ---- : pin(GO_V2O_MODEM_STATUS(MODEM_STATUS_DSR)), negative(FALSE), ! pName(NULL) { for (const char *const *pArgs = &argv[1] ; argc > 1 ; pArgs++, argc--) { *************** *** 162,173 **** } ! State *Filter::GetState(int nPort) { ! PortsMap::iterator iPair = portsMap.find(nPort); if (iPair == portsMap.end()) { ! portsMap.insert(PortPair(nPort, NULL)); ! iPair = portsMap.find(nPort); if (iPair == portsMap.end()) --- 171,182 ---- } ! State *Filter::GetState(HMASTERPORT hPort) { ! PortsMap::iterator iPair = portsMap.find(hPort); if (iPair == portsMap.end()) { ! portsMap.insert(PortPair(hPort, NULL)); ! iPair = portsMap.find(hPort); if (iPair == portsMap.end()) *************** *** 207,211 **** << "Options:" << endl << " --connect=[!]<state> - <state> is cts, dsr, dcd, ring or break (dsr by" << endl ! << " default)." << endl << endl << "IN method input data stream description:" << endl --- 216,221 ---- << "Options:" << endl << " --connect=[!]<state> - <state> is cts, dsr, dcd, ring or break (dsr by" << endl ! << " default). The exclamation sign (!) can be used to" << endl ! << " invert the value." << endl << endl << "IN method input data stream description:" << endl *************** *** 240,249 **** static BOOL CALLBACK Init( HFILTER hFilter, ! HHUB hHub) { _ASSERTE(hFilter != NULL); ! _ASSERTE(hHub != NULL); ! ((Filter *)hFilter)->SetHub(hHub); return TRUE; --- 250,259 ---- static BOOL CALLBACK Init( HFILTER hFilter, ! HMASTERFILTER hMasterFilter) { _ASSERTE(hFilter != NULL); ! _ASSERTE(hMasterFilter != NULL); ! ((Filter *)hFilter)->SetFilterName(pFilterName(hMasterFilter)); return TRUE; *************** *** 252,260 **** static HUB_MSG *InsertConnectState( Filter &filter, ! int nFromPort, HUB_MSG *pInMsg, BOOL pinState) { ! State *pState = filter.GetState(nFromPort); if (!pState) --- 262,270 ---- static HUB_MSG *InsertConnectState( Filter &filter, ! HMASTERPORT hFromPort, HUB_MSG *pInMsg, BOOL pinState) { ! State *pState = filter.GetState(hFromPort); if (!pState) *************** *** 272,278 **** static BOOL CALLBACK InMethod( HFILTER hFilter, ! int nFromPort, HUB_MSG *pInMsg, ! HUB_MSG **ppEchoMsg) { _ASSERTE(hFilter != NULL); --- 282,288 ---- static BOOL CALLBACK InMethod( HFILTER hFilter, ! HMASTERPORT hFromPort, HUB_MSG *pInMsg, ! HUB_MSG **DEBUG_PARAM(ppEchoMsg)) { _ASSERTE(hFilter != NULL); *************** *** 291,295 **** if (fail_options) { ! cerr << ((Filter *)hFilter)->PortName(nFromPort) << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() << " option(s) 0x" << hex << fail_options << dec --- 301,305 ---- if (fail_options) { ! cerr << pPortName(hFromPort) << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() << " option(s) 0x" << hex << fail_options << dec *************** *** 311,315 **** break; ! pInMsg = InsertConnectState(*((Filter *)hFilter), nFromPort, pInMsg, ((pInMsg->u.val & pin) != 0)); break; --- 321,325 ---- break; ! pInMsg = InsertConnectState(*((Filter *)hFilter), hFromPort, pInMsg, ((pInMsg->u.val & pin) != 0)); break; *************** *** 317,321 **** case HUB_MSG_TYPE_BREAK_STATUS: if (((Filter *)hFilter)->pin & GO_BREAK_STATUS) ! pInMsg = InsertConnectState(*((Filter *)hFilter), nFromPort, pInMsg, pInMsg->u.val != 0); break; } --- 327,331 ---- case HUB_MSG_TYPE_BREAK_STATUS: if (((Filter *)hFilter)->pin & GO_BREAK_STATUS) ! pInMsg = InsertConnectState(*((Filter *)hFilter), hFromPort, pInMsg, pInMsg->u.val != 0); break; } |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 12:37:05
|
Update of /cvsroot/com0com/hub4com/plugins/linectl In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31238/plugins/linectl Modified Files: filter.cpp Log Message: Changed plugin API Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/linectl/filter.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** filter.cpp 13 Nov 2008 07:48:35 -0000 1.6 --- filter.cpp 24 Nov 2008 12:37:00 -0000 1.7 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.7 2008/11/24 12:37:00 vfrolov + * Changed plugin API + * * Revision 1.6 2008/11/13 07:48:35 vfrolov * Changed for staticaly linking *************** *** 72,78 **** public: Filter(int argc, const char *const argv[]); ! void SetHub(HHUB _hHub) { hHub = _hHub; } ! const char *PortName(int nPort) const { return pPortName(hHub, nPort); } ! const char *FilterName() const { return pFilterName(hHub, (HFILTER)this); } DWORD soOutMask; --- 75,81 ---- public: Filter(int argc, const char *const argv[]); ! ! void SetFilterName(const char *_pName) { pName = _pName; } ! const char *FilterName() const { return pName; } DWORD soOutMask; *************** *** 80,84 **** private: ! HHUB hHub; void Parse(const char *pArg); --- 83,87 ---- private: ! const char *pName; void Parse(const char *pArg); *************** *** 88,92 **** : soOutMask(0), goInMask(0), ! hHub(NULL) { for (const char *const *pArgs = &argv[1] ; argc > 1 ; pArgs++, argc--) { --- 91,95 ---- : soOutMask(0), goInMask(0), ! pName(NULL) { for (const char *const *pArgs = &argv[1] ; argc > 1 ; pArgs++, argc--) { *************** *** 213,222 **** static BOOL CALLBACK Init( HFILTER hFilter, ! HHUB hHub) { _ASSERTE(hFilter != NULL); ! _ASSERTE(hHub != NULL); ! ((Filter *)hFilter)->SetHub(hHub); return TRUE; --- 216,225 ---- static BOOL CALLBACK Init( HFILTER hFilter, ! HMASTERFILTER hMasterFilter) { _ASSERTE(hFilter != NULL); ! _ASSERTE(hMasterFilter != NULL); ! ((Filter *)hFilter)->SetFilterName(pFilterName(hMasterFilter)); return TRUE; *************** *** 225,230 **** static BOOL CALLBACK OutMethod( HFILTER hFilter, ! int nFromPort, ! int nToPort, HUB_MSG *pOutMsg) { --- 228,233 ---- static BOOL CALLBACK OutMethod( HFILTER hFilter, ! HMASTERPORT hFromPort, ! HMASTERPORT hToPort, HUB_MSG *pOutMsg) { *************** *** 249,255 **** if (fail_options) { ! cerr << ((Filter *)hFilter)->PortName(nFromPort) << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() ! << " for port " << ((Filter *)hFilter)->PortName(nToPort) << " option(s) 0x" << hex << fail_options << dec << " not accepted" << endl; --- 252,258 ---- if (fail_options) { ! cerr << pPortName(hFromPort) << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() ! << " for port " << pPortName(hToPort) << " option(s) 0x" << hex << fail_options << dec << " not accepted" << endl; |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 12:37:05
|
Update of /cvsroot/com0com/hub4com/plugins/pinmap In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31238/plugins/pinmap Modified Files: filter.cpp Log Message: Changed plugin API Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/pinmap/filter.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** filter.cpp 13 Nov 2008 07:51:34 -0000 1.11 --- filter.cpp 24 Nov 2008 12:37:00 -0000 1.12 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.12 2008/11/24 12:37:00 vfrolov + * Changed plugin API + * * Revision 1.11 2008/11/13 07:51:34 vfrolov * Changed for staticaly linking *************** *** 129,136 **** public: Filter(int argc, const char *const argv[]); ! void SetHub(HHUB _hHub) { hHub = _hHub; } ! State *GetState(int nPort); ! const char *PortName(int nPort) const { return pPortName(hHub, nPort); } ! const char *FilterName() const { return pFilterName(hHub, (HFILTER)this); } struct PinOuts { --- 132,139 ---- public: Filter(int argc, const char *const argv[]); ! State *GetState(HMASTERPORT hPort); ! ! void SetFilterName(const char *_pName) { pName = _pName; } ! const char *FilterName() const { return pName; } struct PinOuts { *************** *** 146,153 **** private: ! HHUB hHub; ! typedef map<int, State*> PortsMap; ! typedef pair<int, State*> PortPair; PortsMap portsMap; --- 149,156 ---- private: ! const char *pName; ! typedef map<HMASTERPORT, State*> PortsMap; ! typedef pair<HMASTERPORT, State*> PortPair; PortsMap portsMap; *************** *** 159,163 **** : outMask(0), lmInMask(0), ! hHub(NULL) { for (const char *const *pArgs = &argv[1] ; argc > 1 ; pArgs++, argc--) { --- 162,166 ---- : outMask(0), lmInMask(0), ! pName(NULL) { for (const char *const *pArgs = &argv[1] ; argc > 1 ; pArgs++, argc--) { *************** *** 241,252 **** } ! State *Filter::GetState(int nPort) { ! PortsMap::iterator iPair = portsMap.find(nPort); if (iPair == portsMap.end()) { ! portsMap.insert(PortPair(nPort, NULL)); ! iPair = portsMap.find(nPort); if (iPair == portsMap.end()) --- 244,255 ---- } ! State *Filter::GetState(HMASTERPORT hPort) { ! PortsMap::iterator iPair = portsMap.find(hPort); if (iPair == portsMap.end()) { ! portsMap.insert(PortPair(hPort, NULL)); ! iPair = portsMap.find(hPort); if (iPair == portsMap.end()) *************** *** 356,365 **** static BOOL CALLBACK Init( HFILTER hFilter, ! HHUB hHub) { _ASSERTE(hFilter != NULL); ! _ASSERTE(hHub != NULL); ! ((Filter *)hFilter)->SetHub(hHub); return TRUE; --- 359,368 ---- static BOOL CALLBACK Init( HFILTER hFilter, ! HMASTERFILTER hMasterFilter) { _ASSERTE(hFilter != NULL); ! _ASSERTE(hMasterFilter != NULL); ! ((Filter *)hFilter)->SetFilterName(pFilterName(hMasterFilter)); return TRUE; *************** *** 401,406 **** static BOOL CALLBACK OutMethod( HFILTER hFilter, ! int nFromPort, ! int nToPort, HUB_MSG *pOutMsg) { --- 404,409 ---- static BOOL CALLBACK OutMethod( HFILTER hFilter, ! HMASTERPORT hFromPort, ! HMASTERPORT hToPort, HUB_MSG *pOutMsg) { *************** *** 413,417 **** pOutMsg->u.val |= SO_V2O_PIN_STATE(((Filter *)hFilter)->outMask); ! State *pState = ((Filter *)hFilter)->GetState(nToPort); if (!pState) --- 416,420 ---- pOutMsg->u.val |= SO_V2O_PIN_STATE(((Filter *)hFilter)->outMask); ! State *pState = ((Filter *)hFilter)->GetState(hToPort); if (!pState) *************** *** 434,440 **** if (fail_options) { ! cerr << ((Filter *)hFilter)->PortName(nFromPort) << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() ! << " for port " << ((Filter *)hFilter)->PortName(nToPort) << " option(s) 0x" << hex << fail_options << dec << " not accepted" << endl; --- 437,443 ---- if (fail_options) { ! cerr << pPortName(hFromPort) << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() ! << " for port " << pPortName(hToPort) << " option(s) 0x" << hex << fail_options << dec << " not accepted" << endl; *************** *** 447,451 **** break; case HUB_MSG_TYPE_MODEM_STATUS: { ! State *pState = ((Filter *)hFilter)->GetState(nToPort); if (!pState) --- 450,454 ---- break; case HUB_MSG_TYPE_MODEM_STATUS: { ! State *pState = ((Filter *)hFilter)->GetState(hToPort); if (!pState) *************** *** 462,466 **** case HUB_MSG_TYPE_BREAK_STATUS: { if (((Filter *)hFilter)->lmInMask & LM_BREAK) { ! State *pState = ((Filter *)hFilter)->GetState(nToPort); if (!pState) --- 465,469 ---- case HUB_MSG_TYPE_BREAK_STATUS: { if (((Filter *)hFilter)->lmInMask & LM_BREAK) { ! State *pState = ((Filter *)hFilter)->GetState(hToPort); if (!pState) *************** *** 477,481 **** case HUB_MSG_TYPE_CONNECT: { if (((Filter *)hFilter)->lmInMask & LM_CONNECT) { ! State *pState = ((Filter *)hFilter)->GetState(nToPort); if (!pState) --- 480,484 ---- case HUB_MSG_TYPE_CONNECT: { if (((Filter *)hFilter)->lmInMask & LM_CONNECT) { ! State *pState = ((Filter *)hFilter)->GetState(hToPort); if (!pState) |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 12:37:05
|
Update of /cvsroot/com0com/hub4com/plugins/telnet In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31238/plugins/telnet Modified Files: filter.cpp Log Message: Changed plugin API Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/telnet/filter.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** filter.cpp 13 Nov 2008 07:44:13 -0000 1.6 --- filter.cpp 24 Nov 2008 12:37:00 -0000 1.7 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.7 2008/11/24 12:37:00 vfrolov + * Changed plugin API + * * Revision 1.6 2008/11/13 07:44:13 vfrolov * Changed for staticaly linking *************** *** 107,119 **** public: Filter(int argc, const char *const argv[]); ! void SetHub(HHUB _hHub) { hHub = _hHub; } ! State *GetState(int nPort); TelnetProtocol *CreateProtocol(State *pState, const char *pName); void DelProtocol(State *pState); - const char *PortName(int nPort) const { return pPortName(hHub, nPort); } - const char *FilterName() const { return pFilterName(hHub, (HFILTER)this); } ! TelnetProtocol *GetProtocol(int nPort) { ! State *pState = GetState(nPort); if (!pState) --- 110,122 ---- public: Filter(int argc, const char *const argv[]); ! State *GetState(HMASTERPORT hPort); TelnetProtocol *CreateProtocol(State *pState, const char *pName); void DelProtocol(State *pState); ! void SetFilterName(const char *_pName) { pName = _pName; } ! const char *FilterName() const { return pName; } ! ! TelnetProtocol *GetProtocol(HMASTERPORT hPort) { ! State *pState = GetState(hPort); if (!pState) *************** *** 127,131 **** private: ! HHUB hHub; string terminalType; BOOL suppressEcho; --- 130,134 ---- private: ! const char *pName; string terminalType; BOOL suppressEcho; *************** *** 137,142 **** } comport; ! typedef map<int, State*> PortsMap; ! typedef pair<int, State*> PortPair; PortsMap portsMap; --- 140,145 ---- } comport; ! typedef map<HMASTERPORT, State*> PortsMap; ! typedef pair<HMASTERPORT, State*> PortPair; PortsMap portsMap; *************** *** 144,148 **** Filter::Filter(int argc, const char *const argv[]) ! : hHub(NULL), terminalType("UNKNOWN"), suppressEcho(FALSE), --- 147,151 ---- Filter::Filter(int argc, const char *const argv[]) ! : pName(NULL), terminalType("UNKNOWN"), suppressEcho(FALSE), *************** *** 223,234 **** } ! State *Filter::GetState(int nPort) { ! PortsMap::iterator iPair = portsMap.find(nPort); if (iPair == portsMap.end()) { ! portsMap.insert(PortPair(nPort, NULL)); ! iPair = portsMap.find(nPort); if (iPair == portsMap.end()) --- 226,237 ---- } ! State *Filter::GetState(HMASTERPORT hPort) { ! PortsMap::iterator iPair = portsMap.find(hPort); if (iPair == portsMap.end()) { ! portsMap.insert(PortPair(hPort, NULL)); ! iPair = portsMap.find(hPort); if (iPair == portsMap.end()) *************** *** 423,432 **** static BOOL CALLBACK Init( HFILTER hFilter, ! HHUB hHub) { _ASSERTE(hFilter != NULL); ! _ASSERTE(hHub != NULL); ! ((Filter *)hFilter)->SetHub(hHub); return TRUE; --- 426,435 ---- static BOOL CALLBACK Init( HFILTER hFilter, ! HMASTERFILTER hMasterFilter) { _ASSERTE(hFilter != NULL); ! _ASSERTE(hMasterFilter != NULL); ! ((Filter *)hFilter)->SetFilterName(pFilterName(hMasterFilter)); return TRUE; *************** *** 435,439 **** static BOOL CALLBACK InMethod( HFILTER hFilter, ! int nFromPort, HUB_MSG *pInMsg, HUB_MSG **ppEchoMsg) --- 438,442 ---- static BOOL CALLBACK InMethod( HFILTER hFilter, ! HMASTERPORT hFromPort, HUB_MSG *pInMsg, HUB_MSG **ppEchoMsg) *************** *** 449,453 **** break; ! State *pState = ((Filter *)hFilter)->GetState(nFromPort); if (!pState) --- 452,456 ---- break; ! State *pState = ((Filter *)hFilter)->GetState(hFromPort); if (!pState) *************** *** 477,481 **** break; ! TelnetProtocol *pTelnetProtocol = ((Filter *)hFilter)->GetProtocol(nFromPort); if (!pTelnetProtocol) --- 480,484 ---- break; ! TelnetProtocol *pTelnetProtocol = ((Filter *)hFilter)->GetProtocol(hFromPort); if (!pTelnetProtocol) *************** *** 490,494 **** } case HUB_MSG_TYPE_CONNECT: { ! State *pState = ((Filter *)hFilter)->GetState(nFromPort); if (!pState) --- 493,497 ---- } case HUB_MSG_TYPE_CONNECT: { ! State *pState = ((Filter *)hFilter)->GetState(hFromPort); if (!pState) *************** *** 517,521 **** } ! TelnetProtocol *pTelnetProtocol = ((Filter *)hFilter)->CreateProtocol(pState, ((Filter *)hFilter)->PortName(nFromPort)); if (!pTelnetProtocol) --- 520,524 ---- } ! TelnetProtocol *pTelnetProtocol = ((Filter *)hFilter)->CreateProtocol(pState, pPortName(hFromPort)); if (!pTelnetProtocol) *************** *** 557,562 **** static BOOL CALLBACK OutMethod( HFILTER hFilter, ! int /*nFromPort*/, ! int nToPort, HUB_MSG *pOutMsg) { --- 560,565 ---- static BOOL CALLBACK OutMethod( HFILTER hFilter, ! HMASTERPORT /*nFromPort*/, ! HMASTERPORT hToPort, HUB_MSG *pOutMsg) { *************** *** 571,575 **** pOutMsg->u.val &= ~((Filter *)hFilter)->soMask; ! State *pState = ((Filter *)hFilter)->GetState(nToPort); if (!pState) --- 574,578 ---- pOutMsg->u.val &= ~((Filter *)hFilter)->soMask; ! State *pState = ((Filter *)hFilter)->GetState(hToPort); if (!pState) *************** *** 581,585 **** } case HUB_MSG_TYPE_SET_BR: { ! State *pState = ((Filter *)hFilter)->GetState(nToPort); if (!pState) --- 584,588 ---- } case HUB_MSG_TYPE_SET_BR: { ! State *pState = ((Filter *)hFilter)->GetState(hToPort); if (!pState) *************** *** 613,617 **** |VAL2LC_STOPBITS(-1)|LC_MASK_STOPBITS)) == 0); ! State *pState = ((Filter *)hFilter)->GetState(nToPort); if (!pState) --- 616,620 ---- |VAL2LC_STOPBITS(-1)|LC_MASK_STOPBITS)) == 0); ! State *pState = ((Filter *)hFilter)->GetState(hToPort); if (!pState) *************** *** 656,660 **** } case HUB_MSG_TYPE_SET_PIN_STATE: { ! State *pState = ((Filter *)hFilter)->GetState(nToPort); if (!pState) --- 659,663 ---- } case HUB_MSG_TYPE_SET_PIN_STATE: { ! State *pState = ((Filter *)hFilter)->GetState(hToPort); if (!pState) *************** *** 697,701 **** } case HUB_MSG_TYPE_SET_LSR: { ! State *pState = ((Filter *)hFilter)->GetState(nToPort); if (!pState) --- 700,704 ---- } case HUB_MSG_TYPE_SET_LSR: { ! State *pState = ((Filter *)hFilter)->GetState(hToPort); if (!pState) *************** *** 728,732 **** break; ! TelnetProtocol *pTelnetProtocol = ((Filter *)hFilter)->GetProtocol(nToPort); if (!pTelnetProtocol) --- 731,735 ---- break; ! TelnetProtocol *pTelnetProtocol = ((Filter *)hFilter)->GetProtocol(hToPort); if (!pTelnetProtocol) |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 12:37:05
|
Update of /cvsroot/com0com/hub4com/plugins/serial In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31238/plugins/serial Modified Files: comport.cpp comport.h import.h port.cpp Log Message: Changed plugin API Index: comport.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/comport.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** comport.cpp 13 Nov 2008 07:35:10 -0000 1.15 --- comport.cpp 24 Nov 2008 12:37:00 -0000 1.16 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.16 2008/11/24 12:37:00 vfrolov + * Changed plugin API + * * Revision 1.15 2008/11/13 07:35:10 vfrolov * Changed for staticaly linking *************** *** 108,112 **** const char *pPath) : hMasterPort(NULL), - hHub(NULL), countReadOverlapped(0), countWaitCommEventOverlapped(0), --- 111,114 ---- *************** *** 138,142 **** } ! BOOL ComPort::Init(HMASTERPORT _hMasterPort, HHUB _hHub) { if (!pComIo) { --- 140,144 ---- } ! BOOL ComPort::Init(HMASTERPORT _hMasterPort) { if (!pComIo) { *************** *** 146,150 **** hMasterPort = _hMasterPort; - hHub = _hHub; return TRUE; --- 148,151 ---- *************** *** 268,272 **** _ASSERTE(hMasterPort != NULL); - _ASSERTE(hHub != NULL); _ASSERTE(pComIo != NULL); --- 269,272 ---- *************** *** 281,285 **** msg.u.pv.pVal = &escapeOptions; msg.u.pv.val = 0; ! pOnRead(hHub, hMasterPort, &msg); escapeOptions = pComIo->SetEscMode(escapeOptions, &pBuf, &done); --- 281,285 ---- msg.u.pv.pVal = &escapeOptions; msg.u.pv.val = 0; ! pOnRead(hMasterPort, &msg); escapeOptions = pComIo->SetEscMode(escapeOptions, &pBuf, &done); *************** *** 297,301 **** msg.u.pv.pVal = &intercepted_options; msg.u.pv.val = escapeOptions; ! pOnRead(hHub, hMasterPort, &msg); } } --- 297,301 ---- msg.u.pv.pVal = &intercepted_options; msg.u.pv.val = escapeOptions; ! pOnRead(hMasterPort, &msg); } } *************** *** 318,322 **** msg.type = HUB_MSG_TYPE_FAIL_IN_OPTS; msg.u.val = fail_options; ! pOnRead(hHub, hMasterPort, &msg); if (inOptions & GO_V2O_MODEM_STATUS( --- 318,322 ---- msg.type = HUB_MSG_TYPE_FAIL_IN_OPTS; msg.u.val = fail_options; ! pOnRead(hMasterPort, &msg); if (inOptions & GO_V2O_MODEM_STATUS( *************** *** 357,366 **** msg.type = HUB_MSG_TYPE_CONNECT; msg.u.val = TRUE; ! pOnRead(hHub, hMasterPort, &msg); if (inOptions & GO_LBR_STATUS) { msg.type = HUB_MSG_TYPE_LBR_STATUS; msg.u.val = pComIo->GetBaudRate(); ! pOnRead(hHub, hMasterPort, &msg); } --- 357,366 ---- msg.type = HUB_MSG_TYPE_CONNECT; msg.u.val = TRUE; ! pOnRead(hMasterPort, &msg); if (inOptions & GO_LBR_STATUS) { msg.type = HUB_MSG_TYPE_LBR_STATUS; msg.u.val = pComIo->GetBaudRate(); ! pOnRead(hMasterPort, &msg); } *************** *** 368,372 **** msg.type = HUB_MSG_TYPE_LLC_STATUS; msg.u.val = pComIo->GetLineControl(); ! pOnRead(hHub, hMasterPort, &msg); } --- 368,372 ---- msg.type = HUB_MSG_TYPE_LLC_STATUS; msg.u.val = pComIo->GetLineControl(); ! pOnRead(hMasterPort, &msg); } *************** *** 376,380 **** msg.type = HUB_MSG_TYPE_RBR_STATUS; msg.u.val = pComIo->GetBaudRate(); ! pOnRead(hHub, hMasterPort, &msg); } --- 376,380 ---- msg.type = HUB_MSG_TYPE_RBR_STATUS; msg.u.val = pComIo->GetBaudRate(); ! pOnRead(hMasterPort, &msg); } *************** *** 384,388 **** msg.type = HUB_MSG_TYPE_RLC_STATUS; msg.u.val = pComIo->GetLineControl(); ! pOnRead(hHub, hMasterPort, &msg); } --- 384,388 ---- msg.type = HUB_MSG_TYPE_RLC_STATUS; msg.u.val = pComIo->GetLineControl(); ! pOnRead(hMasterPort, &msg); } *************** *** 391,395 **** msg.u.buf.pBuf = pBuf; msg.u.buf.size = done; ! pOnRead(hHub, hMasterPort, &msg); } --- 391,395 ---- msg.u.buf.pBuf = pBuf; msg.u.buf.size = done; ! pOnRead(hMasterPort, &msg); } *************** *** 516,520 **** if (writeQueued <= writeQueueLimit/2 && (writeQueued + len) > writeQueueLimit/2) ! pOnXoff(hHub, hMasterPort); writeQueued += len; --- 516,520 ---- if (writeQueued <= writeQueueLimit/2 && (writeQueued + len) > writeQueueLimit/2) ! pOnXoffXon(hMasterPort, TRUE); writeQueued += len; *************** *** 551,555 **** msg.type = HUB_MSG_TYPE_LBR_STATUS; msg.u.val = curVal; ! pOnRead(hHub, hMasterPort, &msg); } --- 551,555 ---- msg.type = HUB_MSG_TYPE_LBR_STATUS; msg.u.val = curVal; ! pOnRead(hMasterPort, &msg); } *************** *** 559,563 **** msg.type = HUB_MSG_TYPE_RBR_STATUS; msg.u.val = curVal; // suppose remote equal local ! pOnRead(hHub, hMasterPort, &msg); } } --- 559,563 ---- msg.type = HUB_MSG_TYPE_RBR_STATUS; msg.u.val = curVal; // suppose remote equal local ! pOnRead(hMasterPort, &msg); } } *************** *** 609,613 **** msg.type = HUB_MSG_TYPE_LLC_STATUS; msg.u.val = curVal; ! pOnRead(hHub, hMasterPort, &msg); } --- 609,613 ---- msg.type = HUB_MSG_TYPE_LLC_STATUS; msg.u.val = curVal; ! pOnRead(hMasterPort, &msg); } *************** *** 617,621 **** msg.type = HUB_MSG_TYPE_RLC_STATUS; msg.u.val = curVal; // suppose remote equal local ! pOnRead(hHub, hMasterPort, &msg); } } --- 617,621 ---- msg.type = HUB_MSG_TYPE_RLC_STATUS; msg.u.val = curVal; // suppose remote equal local ! pOnRead(hMasterPort, &msg); } } *************** *** 666,669 **** --- 666,678 ---- } } + else + if (pMsg->type == HUB_MSG_TYPE_ADD_XOFF_XON) { + if (pMsg->u.val) { + countXoff++; + } else { + if (--countXoff == 0 && pComIo) + StartRead(); + } + } return TRUE; *************** *** 712,716 **** if (writeQueued > writeQueueLimit/2 && (writeQueued - len) <= writeQueueLimit/2) ! pOnXon(hHub, hMasterPort); writeQueued -= len; --- 721,725 ---- if (writeQueued > writeQueueLimit/2 && (writeQueued - len) <= writeQueueLimit/2) ! pOnXoffXon(hMasterPort, FALSE); writeQueued -= len; *************** *** 727,731 **** msg.u.buf.size = done; ! pOnRead(hHub, hMasterPort, &msg); if (countXoff > 0 || !pOverlapped->StartRead()) { --- 736,740 ---- msg.u.buf.size = done; ! pOnRead(hMasterPort, &msg); if (countXoff > 0 || !pOverlapped->StartRead()) { *************** *** 769,773 **** msg.u.val = ((DWORD)(BYTE)stat | VAL2MASK(GO_O2V_MODEM_STATUS(inOptions))); ! pOnRead(hHub, hMasterPort, &msg); } } --- 778,782 ---- msg.u.val = ((DWORD)(BYTE)stat | VAL2MASK(GO_O2V_MODEM_STATUS(inOptions))); ! pOnRead(hMasterPort, &msg); } } *************** *** 781,794 **** } - void ComPort::AddXoff(int count) - { - _ASSERTE(pComIo != NULL); - - countXoff += count; - - if (countXoff <= 0) - StartRead(); - } - static FIELD2NAME codeNameTableCommErrors[] = { TOFIELD2NAME2(CE_, RXOVER), --- 790,793 ---- Index: import.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/import.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** import.h 13 Nov 2008 07:35:10 -0000 1.3 --- import.h 24 Nov 2008 12:37:00 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.4 2008/11/24 12:37:00 vfrolov + * Changed plugin API + * * Revision 1.3 2008/11/13 07:35:10 vfrolov * Changed for staticaly linking *************** *** 38,43 **** extern ROUTINE_BUF_FREE *pBufFree; extern ROUTINE_MSG_INSERT_NONE *pMsgInsertNone; ! extern ROUTINE_ON_XOFF *pOnXoff; ! extern ROUTINE_ON_XON *pOnXon; extern ROUTINE_ON_READ *pOnRead; /////////////////////////////////////////////////////////////// --- 41,45 ---- extern ROUTINE_BUF_FREE *pBufFree; extern ROUTINE_MSG_INSERT_NONE *pMsgInsertNone; ! extern ROUTINE_ON_XOFF_XON *pOnXoffXon; extern ROUTINE_ON_READ *pOnRead; /////////////////////////////////////////////////////////////// Index: port.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/port.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** port.cpp 13 Nov 2008 07:35:10 -0000 1.9 --- port.cpp 24 Nov 2008 12:37:00 -0000 1.10 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.10 2008/11/24 12:37:00 vfrolov + * Changed plugin API + * * Revision 1.9 2008/11/13 07:35:10 vfrolov * Changed for staticaly linking *************** *** 287,298 **** static BOOL CALLBACK Init( HPORT hPort, ! HMASTERPORT hMasterPort, ! HHUB hHub) { _ASSERTE(hPort != NULL); _ASSERTE(hMasterPort != NULL); - _ASSERTE(hHub != NULL); ! return ((ComPort *)hPort)->Init(hMasterPort, hHub); } /////////////////////////////////////////////////////////////// --- 290,299 ---- static BOOL CALLBACK Init( HPORT hPort, ! HMASTERPORT hMasterPort) { _ASSERTE(hPort != NULL); _ASSERTE(hMasterPort != NULL); ! return ((ComPort *)hPort)->Init(hMasterPort); } /////////////////////////////////////////////////////////////// *************** *** 324,343 **** } /////////////////////////////////////////////////////////////// - static void CALLBACK AddXoff( - HPORT hPort) - { - _ASSERTE(hPort != NULL); - - ((ComPort *)hPort)->AddXoff(1); - } - /////////////////////////////////////////////////////////////// - static void CALLBACK AddXon( - HPORT hPort) - { - _ASSERTE(hPort != NULL); - - ((ComPort *)hPort)->AddXoff(-1); - } - /////////////////////////////////////////////////////////////// static void CALLBACK LostReport( HPORT hPort) --- 325,328 ---- *************** *** 363,368 **** FakeReadFilter, Write, - AddXoff, - AddXon, LostReport, }; --- 348,351 ---- *************** *** 376,381 **** ROUTINE_BUF_FREE *pBufFree; ROUTINE_MSG_INSERT_NONE *pMsgInsertNone; ! ROUTINE_ON_XOFF *pOnXoff; ! ROUTINE_ON_XON *pOnXon; ROUTINE_ON_READ *pOnRead; /////////////////////////////////////////////////////////////// --- 359,363 ---- ROUTINE_BUF_FREE *pBufFree; ROUTINE_MSG_INSERT_NONE *pMsgInsertNone; ! ROUTINE_ON_XOFF_XON *pOnXoffXon; ROUTINE_ON_READ *pOnRead; /////////////////////////////////////////////////////////////// *************** *** 387,392 **** !ROUTINE_IS_VALID(pHubRoutines, pBufFree) || !ROUTINE_IS_VALID(pHubRoutines, pMsgInsertNone) || ! !ROUTINE_IS_VALID(pHubRoutines, pOnXoff) || ! !ROUTINE_IS_VALID(pHubRoutines, pOnXon) || !ROUTINE_IS_VALID(pHubRoutines, pOnRead)) { --- 369,373 ---- !ROUTINE_IS_VALID(pHubRoutines, pBufFree) || !ROUTINE_IS_VALID(pHubRoutines, pMsgInsertNone) || ! !ROUTINE_IS_VALID(pHubRoutines, pOnXoffXon) || !ROUTINE_IS_VALID(pHubRoutines, pOnRead)) { *************** *** 397,402 **** pBufFree = pHubRoutines->pBufFree; pMsgInsertNone = pHubRoutines->pMsgInsertNone; ! pOnXoff = pHubRoutines->pOnXoff; ! pOnXon = pHubRoutines->pOnXon; pOnRead = pHubRoutines->pOnRead; --- 378,382 ---- pBufFree = pHubRoutines->pBufFree; pMsgInsertNone = pHubRoutines->pMsgInsertNone; ! pOnXoffXon = pHubRoutines->pOnXoffXon; pOnRead = pHubRoutines->pOnRead; Index: comport.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/comport.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** comport.h 13 Nov 2008 07:35:10 -0000 1.10 --- comport.h 24 Nov 2008 12:37:00 -0000 1.11 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.11 2008/11/24 12:37:00 vfrolov + * Changed plugin API + * * Revision 1.10 2008/11/13 07:35:10 vfrolov * Changed for staticaly linking *************** *** 93,97 **** const char *pPath); ! BOOL Init(HMASTERPORT _hMasterPort, HHUB _hHub); BOOL Start(); BOOL FakeReadFilter(HUB_MSG *pInMsg); --- 96,100 ---- const char *pPath); ! BOOL Init(HMASTERPORT _hMasterPort); BOOL Start(); BOOL FakeReadFilter(HUB_MSG *pInMsg); *************** *** 100,104 **** void OnRead(ReadOverlapped *pOverlapped, BYTE *pBuf, DWORD done); void OnCommEvent(WaitCommEventOverlapped *pOverlapped, DWORD eMask); - void AddXoff(int count); void LostReport(); --- 103,106 ---- *************** *** 114,118 **** string name; HMASTERPORT hMasterPort; - HHUB hHub; int countReadOverlapped; int countWaitCommEventOverlapped; --- 116,119 ---- |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 12:37:05
|
Update of /cvsroot/com0com/hub4com/plugins In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31238/plugins Modified Files: plugins_api.h Log Message: Changed plugin API Index: plugins_api.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/plugins_api.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** plugins_api.h 21 Nov 2008 08:16:56 -0000 1.17 --- plugins_api.h 24 Nov 2008 12:36:59 -0000 1.18 *************** *** 28,32 **** /*******************************************************************/ ! #define HUB_MSG_UNION_TYPE_MASK 0xF000 #define HUB_MSG_UNION_TYPE_NONE 0x0000 #define HUB_MSG_UNION_TYPE_BUF 0x1000 --- 28,32 ---- /*******************************************************************/ ! #define HUB_MSG_UNION_TYPES_MASK 0xF000 #define HUB_MSG_UNION_TYPE_NONE 0x0000 #define HUB_MSG_UNION_TYPE_BUF 0x1000 *************** *** 123,126 **** --- 123,127 ---- #define HUB_MSG_TYPE_LLC_STATUS (19 | HUB_MSG_UNION_TYPE_VAL | HUB_MSG_VAL_TYPE_LC) #define HUB_MSG_TYPE_LOOP_TEST (20 | HUB_MSG_UNION_TYPE_HVAL) + #define HUB_MSG_TYPE_ADD_XOFF_XON (21 | HUB_MSG_UNION_TYPE_VAL | HUB_MSG_VAL_TYPE_BOOL) /*******************************************************************/ typedef struct _HUB_MSG { *************** *** 140,146 **** } HUB_MSG; /*******************************************************************/ - DECLARE_HANDLE(HHUB); DECLARE_HANDLE(HMASTERPORT); ! DECLARE_HANDLE(HFILTER); /*******************************************************************/ typedef BYTE *(CALLBACK ROUTINE_BUF_ALLOC)( --- 141,146 ---- } HUB_MSG; /*******************************************************************/ DECLARE_HANDLE(HMASTERPORT); ! DECLARE_HANDLE(HMASTERFILTER); /*******************************************************************/ typedef BYTE *(CALLBACK ROUTINE_BUF_ALLOC)( *************** *** 172,191 **** HUB_MSG *pMsg, WORD type); - typedef int (CALLBACK ROUTINE_NUM_PORTS)( - HHUB hHub); typedef const char *(CALLBACK ROUTINE_PORT_NAME_A)( - HHUB hHub, - int n); - typedef const char *(CALLBACK ROUTINE_FILTER_NAME_A)( - HHUB hHub, - HFILTER hFilter); - typedef void (CALLBACK ROUTINE_ON_XOFF)( - HHUB hHub, - HMASTERPORT hMasterPort); - typedef void (CALLBACK ROUTINE_ON_XON)( - HHUB hHub, HMASTERPORT hMasterPort); typedef void (CALLBACK ROUTINE_ON_READ)( - HHUB hHub, HMASTERPORT hMasterPort, HUB_MSG *pMsg); --- 172,183 ---- HUB_MSG *pMsg, WORD type); typedef const char *(CALLBACK ROUTINE_PORT_NAME_A)( HMASTERPORT hMasterPort); + typedef const char *(CALLBACK ROUTINE_FILTER_NAME_A)( + HMASTERFILTER hMasterFilter); + typedef void (CALLBACK ROUTINE_ON_XOFF_XON)( + HMASTERPORT hMasterPort, + BOOL xoff); typedef void (CALLBACK ROUTINE_ON_READ)( HMASTERPORT hMasterPort, HUB_MSG *pMsg); *************** *** 201,209 **** ROUTINE_MSG_REPLACE_NONE *pMsgReplaceNone; ROUTINE_MSG_INSERT_NONE *pMsgInsertNone; - ROUTINE_NUM_PORTS *pNumPorts; ROUTINE_PORT_NAME_A *pPortName; ROUTINE_FILTER_NAME_A *pFilterName; ! ROUTINE_ON_XOFF *pOnXoff; ! ROUTINE_ON_XON *pOnXon; ROUTINE_ON_READ *pOnRead; } HUB_ROUTINES_A; --- 193,199 ---- ROUTINE_MSG_REPLACE_NONE *pMsgReplaceNone; ROUTINE_MSG_INSERT_NONE *pMsgInsertNone; ROUTINE_PORT_NAME_A *pPortName; ROUTINE_FILTER_NAME_A *pFilterName; ! ROUTINE_ON_XOFF_XON *pOnXoffXon; ROUTINE_ON_READ *pOnRead; } HUB_ROUTINES_A; *************** *** 255,258 **** --- 245,250 ---- const HUB_ROUTINES_A *pHubRoutines); /*******************************************************************/ + DECLARE_HANDLE(HFILTER); + /*******************************************************************/ typedef HFILTER (CALLBACK FILTER_CREATE_A)( HCONFIG hConfig, *************** *** 261,274 **** typedef BOOL (CALLBACK FILTER_INIT)( HFILTER hFilter, ! HHUB hHub); typedef BOOL (CALLBACK FILTER_IN_METHOD)( HFILTER hFilter, ! int nFromPort, HUB_MSG *pInMsg, HUB_MSG **ppEchoMsg); typedef BOOL (CALLBACK FILTER_OUT_METHOD)( HFILTER hFilter, ! int nFromPort, ! int nToPort, HUB_MSG *pOutMsg); /*******************************************************************/ --- 253,266 ---- typedef BOOL (CALLBACK FILTER_INIT)( HFILTER hFilter, ! HMASTERFILTER hMasterFilter); typedef BOOL (CALLBACK FILTER_IN_METHOD)( HFILTER hFilter, ! HMASTERPORT hFromPort, HUB_MSG *pInMsg, HUB_MSG **ppEchoMsg); typedef BOOL (CALLBACK FILTER_OUT_METHOD)( HFILTER hFilter, ! HMASTERPORT hFromPort, ! HMASTERPORT hToPort, HUB_MSG *pOutMsg); /*******************************************************************/ *************** *** 293,298 **** typedef BOOL (CALLBACK PORT_INIT)( HPORT hPort, ! HMASTERPORT hMasterPort, ! HHUB hHub); typedef BOOL (CALLBACK PORT_START)( HPORT hPort); --- 285,289 ---- typedef BOOL (CALLBACK PORT_INIT)( HPORT hPort, ! HMASTERPORT hMasterPort); typedef BOOL (CALLBACK PORT_START)( HPORT hPort); *************** *** 303,310 **** HPORT hPort, HUB_MSG *pMsg); - typedef void (CALLBACK PORT_ADD_XOFF)( - HPORT hPort); - typedef void (CALLBACK PORT_ADD_XON)( - HPORT hPort); typedef void (CALLBACK PORT_LOST_REPORT)( HPORT hPort); --- 294,297 ---- *************** *** 319,324 **** PORT_FAKE_READ_FILTER *pFakeReadFilter; PORT_WRITE *pWrite; - PORT_ADD_XOFF *pAddXoff; - PORT_ADD_XON *pAddXon; PORT_LOST_REPORT *pLostReport; } PORT_ROUTINES_A; --- 306,309 ---- |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 12:37:05
|
Update of /cvsroot/com0com/hub4com/plugins/awakseq In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31238/plugins/awakseq Modified Files: filter.cpp Log Message: Changed plugin API Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/awakseq/filter.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** filter.cpp 13 Nov 2008 07:45:07 -0000 1.8 --- filter.cpp 24 Nov 2008 12:36:59 -0000 1.9 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.9 2008/11/24 12:36:59 vfrolov + * Changed plugin API + * * Revision 1.8 2008/11/13 07:45:07 vfrolov * Changed for staticaly linking *************** *** 90,94 **** public: Filter(int argc, const char *const argv[]); ! State *GetState(int nPort); const BYTE *pAwakSeq; --- 93,97 ---- public: Filter(int argc, const char *const argv[]); ! State *GetState(HMASTERPORT hPort); const BYTE *pAwakSeq; *************** *** 96,101 **** private: ! typedef map<int, State*> PortsMap; ! typedef pair<int, State*> PortPair; PortsMap portsMap; --- 99,104 ---- private: ! typedef map<HMASTERPORT, State*> PortsMap; ! typedef pair<HMASTERPORT, State*> PortPair; PortsMap portsMap; *************** *** 123,134 **** } ! State *Filter::GetState(int nPort) { ! PortsMap::iterator iPair = portsMap.find(nPort); if (iPair == portsMap.end()) { ! portsMap.insert(PortPair(nPort, NULL)); ! iPair = portsMap.find(nPort); if (iPair == portsMap.end()) --- 126,137 ---- } ! State *Filter::GetState(HMASTERPORT hPort) { ! PortsMap::iterator iPair = portsMap.find(hPort); if (iPair == portsMap.end()) { ! portsMap.insert(PortPair(hPort, NULL)); ! iPair = portsMap.find(hPort); if (iPair == portsMap.end()) *************** *** 206,210 **** static BOOL CALLBACK InMethod( HFILTER hFilter, ! int nFromPort, HUB_MSG *pInMsg, HUB_MSG **DEBUG_PARAM(ppEchoMsg)) --- 209,213 ---- static BOOL CALLBACK InMethod( HFILTER hFilter, ! HMASTERPORT hFromPort, HUB_MSG *pInMsg, HUB_MSG **DEBUG_PARAM(ppEchoMsg)) *************** *** 223,227 **** return TRUE; ! State *pState = ((Filter *)hFilter)->GetState(nFromPort); if (!pState) --- 226,230 ---- return TRUE; ! State *pState = ((Filter *)hFilter)->GetState(hFromPort); if (!pState) *************** *** 282,286 **** return FALSE; } else { ! State *pState = ((Filter *)hFilter)->GetState(nFromPort); if (!pState) --- 285,289 ---- return FALSE; } else { ! State *pState = ((Filter *)hFilter)->GetState(hFromPort); if (!pState) *************** *** 306,311 **** static BOOL CALLBACK OutMethod( HFILTER hFilter, ! int /*nFromPort*/, ! int nToPort, HUB_MSG *pOutMsg) { --- 309,314 ---- static BOOL CALLBACK OutMethod( HFILTER hFilter, ! HMASTERPORT /*nFromPort*/, ! HMASTERPORT hToPort, HUB_MSG *pOutMsg) { *************** *** 315,319 **** if (pOutMsg->type == HUB_MSG_TYPE_CONNECT) { ! State *pState = ((Filter *)hFilter)->GetState(nToPort); if (!pState) --- 318,322 ---- if (pOutMsg->type == HUB_MSG_TYPE_CONNECT) { ! State *pState = ((Filter *)hFilter)->GetState(hToPort); if (!pState) |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 12:37:05
|
Update of /cvsroot/com0com/hub4com/plugins/tcp In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31238/plugins/tcp Modified Files: comport.cpp comport.h import.h port.cpp Log Message: Changed plugin API Index: comport.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comport.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** comport.cpp 17 Nov 2008 16:44:57 -0000 1.8 --- comport.cpp 24 Nov 2008 12:37:00 -0000 1.9 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.9 2008/11/24 12:37:00 vfrolov + * Changed plugin API + * * Revision 1.8 2008/11/17 16:44:57 vfrolov * Fixed race conditions *************** *** 125,129 **** name("TCP"), hMasterPort(NULL), - hHub(NULL), countReadOverlapped(0), countXoff(0), --- 128,131 ---- *************** *** 187,194 **** } ! BOOL ComPort::Init(HMASTERPORT _hMasterPort, HHUB _hHub) { hMasterPort = _hMasterPort; - hHub = _hHub; return isValid; --- 189,195 ---- } ! BOOL ComPort::Init(HMASTERPORT _hMasterPort) { hMasterPort = _hMasterPort; return isValid; *************** *** 198,202 **** { _ASSERTE(hMasterPort != NULL); - _ASSERTE(hHub != NULL); if (pListener) { --- 199,202 ---- *************** *** 331,335 **** if (writeQueued <= writeQueueLimit/2 && (writeQueued + len) > writeQueueLimit/2) ! pOnXoff(hHub, hMasterPort); writeQueued += len; --- 331,335 ---- if (writeQueued <= writeQueueLimit/2 && (writeQueued + len) > writeQueueLimit/2) ! pOnXoffXon(hMasterPort, TRUE); writeQueued += len; *************** *** 367,370 **** --- 367,379 ---- } } + else + if (pMsg->type == HUB_MSG_TYPE_ADD_XOFF_XON) { + if (pMsg->u.val) { + countXoff++; + } else { + if (--countXoff == 0 && isConnected) + StartRead(); + } + } return TRUE; *************** *** 401,405 **** if (writeQueued > writeQueueLimit/2 && (writeQueued - len) <= writeQueueLimit/2) ! pOnXon(hHub, hMasterPort); writeQueued -= len; --- 410,414 ---- if (writeQueued > writeQueueLimit/2 && (writeQueued - len) <= writeQueueLimit/2) ! pOnXoffXon(hMasterPort, FALSE); writeQueued -= len; *************** *** 414,418 **** msg.u.buf.size = done; ! pOnRead(hHub, hMasterPort, &msg); if (done == 0 && isDisconnected) { --- 423,427 ---- msg.u.buf.size = done; ! pOnRead(hMasterPort, &msg); if (done == 0 && isDisconnected) { *************** *** 451,455 **** msg.u.val = FALSE; ! pOnRead(hHub, hMasterPort, &msg); } --- 460,464 ---- msg.u.val = FALSE; ! pOnRead(hMasterPort, &msg); } *************** *** 543,555 **** msg.u.val = TRUE; ! pOnRead(hHub, hMasterPort, &msg); ! } ! ! void ComPort::AddXoff(int count) ! { ! countXoff += count; ! ! if (countXoff <= 0 && isConnected) ! StartRead(); } --- 552,556 ---- msg.u.val = TRUE; ! pOnRead(hMasterPort, &msg); } Index: import.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/import.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** import.h 13 Nov 2008 07:41:09 -0000 1.2 --- import.h 24 Nov 2008 12:37:00 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2008/11/24 12:37:00 vfrolov + * Changed plugin API + * * Revision 1.2 2008/11/13 07:41:09 vfrolov * Changed for staticaly linking *************** *** 34,39 **** extern ROUTINE_BUF_ALLOC *pBufAlloc; extern ROUTINE_BUF_FREE *pBufFree; ! extern ROUTINE_ON_XOFF *pOnXoff; ! extern ROUTINE_ON_XON *pOnXon; extern ROUTINE_ON_READ *pOnRead; /////////////////////////////////////////////////////////////// --- 37,41 ---- extern ROUTINE_BUF_ALLOC *pBufAlloc; extern ROUTINE_BUF_FREE *pBufFree; ! extern ROUTINE_ON_XOFF_XON *pOnXoffXon; extern ROUTINE_ON_READ *pOnRead; /////////////////////////////////////////////////////////////// Index: port.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/port.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** port.cpp 13 Nov 2008 07:41:09 -0000 1.7 --- port.cpp 24 Nov 2008 12:37:00 -0000 1.8 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.8 2008/11/24 12:37:00 vfrolov + * Changed plugin API + * * Revision 1.7 2008/11/13 07:41:09 vfrolov * Changed for staticaly linking *************** *** 235,246 **** static BOOL CALLBACK Init( HPORT hPort, ! HMASTERPORT hMasterPort, ! HHUB hHub) { _ASSERTE(hPort != NULL); _ASSERTE(hMasterPort != NULL); - _ASSERTE(hHub != NULL); ! return ((ComPort *)hPort)->Init(hMasterPort, hHub); } /////////////////////////////////////////////////////////////// --- 238,247 ---- static BOOL CALLBACK Init( HPORT hPort, ! HMASTERPORT hMasterPort) { _ASSERTE(hPort != NULL); _ASSERTE(hMasterPort != NULL); ! return ((ComPort *)hPort)->Init(hMasterPort); } /////////////////////////////////////////////////////////////// *************** *** 262,281 **** } /////////////////////////////////////////////////////////////// - static void CALLBACK AddXoff( - HPORT hPort) - { - _ASSERTE(hPort != NULL); - - ((ComPort *)hPort)->AddXoff(1); - } - /////////////////////////////////////////////////////////////// - static void CALLBACK AddXon( - HPORT hPort) - { - _ASSERTE(hPort != NULL); - - ((ComPort *)hPort)->AddXoff(-1); - } - /////////////////////////////////////////////////////////////// static void CALLBACK LostReport( HPORT hPort) --- 263,266 ---- *************** *** 301,306 **** NULL, // FakeReadFilter Write, - AddXoff, - AddXon, LostReport, }; --- 286,289 ---- *************** *** 313,318 **** ROUTINE_BUF_ALLOC *pBufAlloc; ROUTINE_BUF_FREE *pBufFree; ! ROUTINE_ON_XOFF *pOnXoff; ! ROUTINE_ON_XON *pOnXon; ROUTINE_ON_READ *pOnRead; /////////////////////////////////////////////////////////////// --- 296,300 ---- ROUTINE_BUF_ALLOC *pBufAlloc; ROUTINE_BUF_FREE *pBufFree; ! ROUTINE_ON_XOFF_XON *pOnXoffXon; ROUTINE_ON_READ *pOnRead; /////////////////////////////////////////////////////////////// *************** *** 323,328 **** if (!ROUTINE_IS_VALID(pHubRoutines, pBufAlloc) || !ROUTINE_IS_VALID(pHubRoutines, pBufFree) || ! !ROUTINE_IS_VALID(pHubRoutines, pOnXoff) || ! !ROUTINE_IS_VALID(pHubRoutines, pOnXon) || !ROUTINE_IS_VALID(pHubRoutines, pOnRead)) { --- 305,309 ---- if (!ROUTINE_IS_VALID(pHubRoutines, pBufAlloc) || !ROUTINE_IS_VALID(pHubRoutines, pBufFree) || ! !ROUTINE_IS_VALID(pHubRoutines, pOnXoffXon) || !ROUTINE_IS_VALID(pHubRoutines, pOnRead)) { *************** *** 332,337 **** pBufAlloc = pHubRoutines->pBufAlloc; pBufFree = pHubRoutines->pBufFree; ! pOnXoff = pHubRoutines->pOnXoff; ! pOnXon = pHubRoutines->pOnXon; pOnRead = pHubRoutines->pOnRead; --- 313,317 ---- pBufAlloc = pHubRoutines->pBufAlloc; pBufFree = pHubRoutines->pBufFree; ! pOnXoffXon = pHubRoutines->pOnXoffXon; pOnRead = pHubRoutines->pOnRead; Index: comport.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comport.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** comport.h 17 Nov 2008 16:44:57 -0000 1.5 --- comport.h 24 Nov 2008 12:37:00 -0000 1.6 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.6 2008/11/24 12:37:00 vfrolov + * Changed plugin API + * * Revision 1.5 2008/11/17 16:44:57 vfrolov * Fixed race conditions *************** *** 83,87 **** const char *pPath); ! BOOL Init(HMASTERPORT _hMasterPort, HHUB _hHub); BOOL Start(); BOOL Write(HUB_MSG *pMsg); --- 86,90 ---- const char *pPath); ! BOOL Init(HMASTERPORT _hMasterPort); BOOL Start(); BOOL Write(HUB_MSG *pMsg); *************** *** 89,93 **** void OnRead(ReadOverlapped *pOverlapped, BYTE *pBuf, DWORD done); BOOL OnEvent(WaitEventOverlapped *pOverlapped, long e); - void AddXoff(int count); void LostReport(); void Accept(); --- 92,95 ---- *************** *** 122,126 **** string name; HMASTERPORT hMasterPort; - HHUB hHub; int countReadOverlapped; --- 124,127 ---- |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 11:48:02
|
Update of /cvsroot/com0com/hub4com In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24809 Modified Files: hub4com.vcproj Log Message: Added filter.h Index: hub4com.vcproj =================================================================== RCS file: /cvsroot/com0com/hub4com/hub4com.vcproj,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** hub4com.vcproj 13 Nov 2008 08:04:37 -0000 1.7 --- hub4com.vcproj 24 Nov 2008 11:47:49 -0000 1.8 *************** *** 191,194 **** --- 191,198 ---- </File> <File + RelativePath=".\filter.h" + > + </File> + <File RelativePath=".\filters.h" > |
From: Vyacheslav F. <vf...@us...> - 2008-11-24 11:47:13
|
Update of /cvsroot/com0com/hub4com In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24731 Added Files: filter.h Log Message: Initial revision --- NEW FILE: filter.h --- /* * $Id: filter.h,v 1.1 2008/11/24 11:46:56 vfrolov Exp $ * * Copyright (c) 2008 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * $Log: filter.h,v $ * Revision 1.1 2008/11/24 11:46:56 vfrolov * Initial revision * */ #ifndef _FILTER_H #define _FILTER_H /////////////////////////////////////////////////////////////// #define FILTER_SIGNATURE 'h4cF' /////////////////////////////////////////////////////////////// class Filter { public: Filter( const char *pGroup, const char *pName, HFILTER _hFilter, FILTER_IN_METHOD *_pInMethod, FILTER_OUT_METHOD *_pOutMethod) : group(pGroup), name(pName), hFilter(_hFilter), pInMethod(_pInMethod), pOutMethod(_pOutMethod) { #ifdef _DEBUG signature = FILTER_SIGNATURE; #endif } #ifdef _DEBUG ~Filter() { _ASSERTE(signature == FILTER_SIGNATURE); signature = 0; } #endif const string group; const string name; const HFILTER hFilter; FILTER_IN_METHOD *const pInMethod; FILTER_OUT_METHOD *const pOutMethod; #ifdef _DEBUG private: DWORD signature; public: BOOL IsValid() { return signature == FILTER_SIGNATURE; } #endif }; /////////////////////////////////////////////////////////////// #endif // _FILTER_H |
From: Vyacheslav F. <vf...@us...> - 2008-11-21 08:17:02
|
Update of /cvsroot/com0com/hub4com In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19456 Modified Files: comhub.cpp Log Message: Added HUB_MSG_TYPE_LOOP_TEST Index: comhub.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/comhub.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** comhub.cpp 13 Nov 2008 08:07:40 -0000 1.10 --- comhub.cpp 21 Nov 2008 08:16:56 -0000 1.11 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.11 2008/11/21 08:16:56 vfrolov + * Added HUB_MSG_TYPE_LOOP_TEST + * * Revision 1.10 2008/11/13 08:07:40 vfrolov * Changed for staticaly linking *************** *** 109,112 **** --- 112,124 ---- HubMsg msg; + msg.type = HUB_MSG_TYPE_LOOP_TEST; + + if (!OnFakeRead(*i, &msg)) + return FALSE; + } + + for (Ports::const_iterator i = ports.begin() ; i != ports.end() ; i++) { + HubMsg msg; + msg.type = HUB_MSG_TYPE_SET_OUT_OPTS; |
From: Vyacheslav F. <vf...@us...> - 2008-11-21 08:17:02
|
Update of /cvsroot/com0com/hub4com/plugins/trace In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19456/plugins/trace Modified Files: filter.cpp Log Message: Added HUB_MSG_TYPE_LOOP_TEST Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/trace/filter.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** filter.cpp 13 Nov 2008 07:52:20 -0000 1.8 --- filter.cpp 21 Nov 2008 08:16:56 -0000 1.9 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.9 2008/11/21 08:16:56 vfrolov + * Added HUB_MSG_TYPE_LOOP_TEST + * * Revision 1.8 2008/11/13 07:52:20 vfrolov * Changed for staticaly linking *************** *** 114,118 **** if (!pStream->is_open()) { ! cerr << "Can't open " << path.c_str() << endl; exit(2); } --- 117,121 ---- if (!pStream->is_open()) { ! cerr << "Can't open " << path << endl; exit(2); } *************** *** 426,429 **** --- 429,433 ---- TOCODE2NAME(HUB_MSG_TYPE_, LBR_STATUS), TOCODE2NAME(HUB_MSG_TYPE_, LLC_STATUS), + TOCODE2NAME(HUB_MSG_TYPE_, LOOP_TEST), {0, NULL} }; *************** *** 625,628 **** --- 629,635 ---- PrintVal(tout, pMsg->type, pMsg->u.pv.val); break; + case HUB_MSG_UNION_TYPE_HVAL: + tout << pMsg->u.hVal; + break; default: tout << "???"; |
From: Vyacheslav F. <vf...@us...> - 2008-11-21 08:17:02
|
Update of /cvsroot/com0com/hub4com/plugins In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19456/plugins Modified Files: plugins_api.h Log Message: Added HUB_MSG_TYPE_LOOP_TEST Index: plugins_api.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/plugins_api.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** plugins_api.h 22 Oct 2008 08:27:26 -0000 1.16 --- plugins_api.h 21 Nov 2008 08:16:56 -0000 1.17 *************** *** 33,36 **** --- 33,37 ---- #define HUB_MSG_UNION_TYPE_VAL 0x2000 #define HUB_MSG_UNION_TYPE_PVAL 0x3000 + #define HUB_MSG_UNION_TYPE_HVAL 0x4000 /*******************************************************************/ #define HUB_MSG_VAL_TYPES_MASK 0x0F00 *************** *** 121,124 **** --- 122,126 ---- #define HUB_MSG_TYPE_LBR_STATUS (18 | HUB_MSG_UNION_TYPE_VAL | HUB_MSG_VAL_TYPE_UINT) #define HUB_MSG_TYPE_LLC_STATUS (19 | HUB_MSG_UNION_TYPE_VAL | HUB_MSG_VAL_TYPE_LC) + #define HUB_MSG_TYPE_LOOP_TEST (20 | HUB_MSG_UNION_TYPE_HVAL) /*******************************************************************/ typedef struct _HUB_MSG { *************** *** 134,137 **** --- 136,140 ---- } pv; DWORD val; + HANDLE hVal; } u; } HUB_MSG; |
From: Vyacheslav F. <vf...@us...> - 2008-11-18 10:21:18
|
Update of /cvsroot/com0com/hub4com/examples In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17114 Modified Files: com2tcp-rfc2217.bat Log Message: Added --connect option Index: com2tcp-rfc2217.bat =================================================================== RCS file: /cvsroot/com0com/hub4com/examples/com2tcp-rfc2217.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** com2tcp-rfc2217.bat 24 Oct 2008 09:00:23 -0000 1.1 --- com2tcp-rfc2217.bat 18 Nov 2008 10:21:13 -0000 1.2 *************** *** 8,11 **** --- 8,13 ---- PATH %~dp0;%PATH% + SET PERMANENT=* + :BEGIN_PARSE_OPTIONS SET OPTION=%1 *************** *** 36,39 **** --- 38,48 ---- :END_OPTION_RFC2217_MODE + IF /I "%OPTION%" NEQ "--connect" GOTO END_OPTION_CONNECT + SET COM_PIN2CON=--create-filter=pin2con,com,connect:%1 + SET PERMANENT= + SHIFT /1 + GOTO BEGIN_PARSE_OPTIONS + :END_OPTION_CONNECT + GOTO USAGE :END_PARSE_OPTIONS *************** *** 86,89 **** --- 95,99 ---- SET OPTIONS=%OPTIONS% --create-filter=escparse,com,parse %TC% SET OPTIONS=%OPTIONS% --create-filter=trace,com,ExM + SET OPTIONS=%OPTIONS% %COM_PIN2CON% SET OPTIONS=%OPTIONS% --create-filter=pinmap,com,pinmap%COM_PINMAP_OPTIONS% SET OPTIONS=%OPTIONS% --create-filter=linectl,com,lc%COM_LC_OPTIONS% *************** *** 102,106 **** @ECHO ON ! "%HUB4COM%" %OPTIONS% --octs=off "%COMPORT%" --use-driver=tcp "*%TCP%" @ECHO OFF ENDLOCAL --- 112,116 ---- @ECHO ON ! "%HUB4COM%" %OPTIONS% --octs=off "%COMPORT%" --use-driver=tcp "%PERMANENT%%TCP%" @ECHO OFF ENDLOCAL *************** *** 119,122 **** --- 129,137 ---- ECHO --rfc2217-mode ^{c^|s^} - use RFC 2217 (c)lient or (s)erver mode (default is ECHO c for TCP client mode and s for TCP server mode). + ECHO --connect ^[^!^]^<state^> - connect or disconnect on ^<state^> changing. Where + ECHO ^<state^> is cts, dsr, dcd, ring or break. The + ECHO exclamation sign ^(^!^) can be used to invert the + ECHO action. By default the connection will be permanent + ECHO as it's possible. ECHO --help - show this help. ECHO. |