com0com-cvs Mailing List for Null-modem emulator (Page 15)
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-17 16:46:59
|
Update of /cvsroot/com0com/hub4com In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29244 Modified Files: ReadMe.txt Log Message: Added CHAT server and CVS proxy examples Index: ReadMe.txt =================================================================== RCS file: /cvsroot/com0com/hub4com/ReadMe.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ReadMe.txt 14 Nov 2008 15:29:57 -0000 1.4 --- ReadMe.txt 17 Nov 2008 16:46:51 -0000 1.5 *************** *** 44,47 **** --- 44,50 ---- ================= + GPS hub + ------- + You have a GPS device that connected to your computer via a phisical COM1 port and you'd like to handle its data by two GPS applications. You can *************** *** 64,68 **** 3. Start the GPS applications on COM5 and COM6 ports. ! --- You have old TERM95.EXE application from the Norton Commander 5.0 for --- 67,73 ---- 3. Start the GPS applications on COM5 and COM6 ports. ! ! COM port to telnet redirector ! ----------------------------- You have old TERM95.EXE application from the Norton Commander 5.0 for *************** *** 85,89 **** com2tcp's options. ! --- You have a phisical COM1 port and you'd like to share it through the --- 90,96 ---- com2tcp's options. ! ! RFC 2217 COM port server ! ------------------------ You have a phisical COM1 port and you'd like to share it through the *************** *** 97,101 **** redirect them to COM1 port. ! --- On the first computer your.comport.server you have a phisical serial port --- 104,110 ---- redirect them to COM1 port. ! ! COM port to TCP redirector (RFC 2217) ! ------------------------------------- On the first computer your.comport.server you have a phisical serial port *************** *** 114,115 **** --- 123,168 ---- It will redirect virtual serial port COM5 on the second computer to the phisical serial port on the first computer. + + + CHAT server + ----------- + + You'd like by using computer with address your.computer.addr to allow up + to 5 users to chat by using ordinary telnet application. + + 1. Start the hub4com.exe on the computer with address your.computer.addr: + + hub4com --load=,,_END_ + --create-filter=telnet + --add-filters=All:telnet + --route=All:All + --use-driver=tcp + *5555 + *5555 + *5555 + *5555 + *5555 + _END_ + + 2. Now users can join to the chat by connecting to port 5555 of your + computer. For example: + + telnet your.computer.addr 5555 + + + CVS proxy + --------- + + You have a computer that has not access to the internet and you'd like to + allow it to access to hub4com's CVS repository by using proxy computer + with address your.computer.addr. + + 1. Start the hub4com.exe on the computer with address your.computer.addr: + + hub4com.exe --use-driver=tcp 2401 com0com.cvs.sourceforge.net:2401 + + 2. On computer that has not access to the internet check out the hub4com + souce code from the CVS repository: + + cvs -d:pserver:ano...@yo...dr:/cvsroot/com0com login + cvs -z3 -d:pserver:anonymous@172.16.36.111:/cvsroot/com0com co -P hub4com |
From: Vyacheslav F. <vf...@us...> - 2008-11-17 16:45:05
|
Update of /cvsroot/com0com/hub4com/plugins/tcp In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28769 Modified Files: comio.cpp comio.h comport.cpp comport.h Log Message: Fixed race conditions Index: comport.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comport.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** comport.cpp 13 Nov 2008 07:41:09 -0000 1.7 --- comport.cpp 17 Nov 2008 16:44:57 -0000 1.8 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.8 2008/11/17 16:44:57 vfrolov + * Fixed race conditions + * * Revision 1.7 2008/11/13 07:41:09 vfrolov * Changed for staticaly linking *************** *** 89,93 **** BOOL Listener::OnEvent(ListenOverlapped * /*pOverlapped*/, long e, int /*err*/) { ! //cout << "OnEvent " << hex << e << dec << " " << err << endl; if (e == FD_ACCEPT) { --- 92,96 ---- BOOL Listener::OnEvent(ListenOverlapped * /*pOverlapped*/, long e, int /*err*/) { ! //cout << "Listener::OnEvent " << hex << e << dec << " " << err << endl; if (e == FD_ACCEPT) { *************** *** 116,119 **** --- 119,123 ---- hSock(INVALID_SOCKET), isConnected(FALSE), + isDisconnected(FALSE), connectionCounter(0), reconnectTime(-1), *************** *** 245,250 **** return; ! if (!StartWaitEvent(hSock) || !Connect(hSock, snRemote)) hSock = INVALID_SOCKET; } --- 249,256 ---- return; ! if (!StartWaitEvent(hSock) || !Connect(hSock, snRemote)) { ! Close(hSock); hSock = INVALID_SOCKET; + } } *************** *** 252,255 **** --- 258,262 ---- { _ASSERTE(pListener); + _ASSERTE(hSock == INVALID_SOCKET); if (hSock != INVALID_SOCKET) *************** *** 285,289 **** } ! if (hSock == INVALID_SOCKET) { writeLost += len; return FALSE; --- 292,296 ---- } ! if (hSock == INVALID_SOCKET || isDisconnected) { writeLost += len; return FALSE; *************** *** 348,364 **** connectionCounter--; ! if (hSock != INVALID_SOCKET && !permanent && connectionCounter <= 0) { ! Disconnect(hSock); ! ! isConnected = FALSE; ! hSock = INVALID_SOCKET; ! ! HUB_MSG msg; ! ! msg.type = HUB_MSG_TYPE_CONNECT; ! msg.u.val = FALSE; ! ! pOnRead(hHub, hMasterPort, &msg); ! } } } --- 355,360 ---- connectionCounter--; ! if (hSock != INVALID_SOCKET && !permanent && connectionCounter <= 0) ! PortTcp::Disconnect(hSock); } } *************** *** 420,428 **** pOnRead(hHub, hMasterPort, &msg); if (countXoff > 0 || !isConnected || !pOverlapped->StartRead()) { delete pOverlapped; countReadOverlapped--; - - //cout << "Stopped Read " << name << " " << countReadOverlapped << endl; } } --- 416,429 ---- pOnRead(hHub, hMasterPort, &msg); + if (done == 0 && isDisconnected) { + isDisconnected = FALSE; + OnDisconnect(); + } + if (countXoff > 0 || !isConnected || !pOverlapped->StartRead()) { + _ASSERTE(countReadOverlapped > 0); + delete pOverlapped; countReadOverlapped--; } } *************** *** 437,490 **** } ! BOOL ComPort::OnEvent(WaitEventOverlapped *pOverlapped, long e, int err) { ! //cout << "OnEvent " << name << " " << hex << e << dec << " " << err << endl; ! ! if (e == FD_CLOSE || (e == FD_CONNECT && err != ERROR_SUCCESS)) { ! if (hSock == pOverlapped->Sock()) { ! hSock = INVALID_SOCKET; ! ! if (isConnected) { ! isConnected = FALSE; ! HUB_MSG msg; ! msg.type = HUB_MSG_TYPE_CONNECT; ! msg.u.val = FALSE; ! pOnRead(hHub, hMasterPort, &msg); ! } ! if (pListener) { ! Accept(); ! } ! else ! if (CanConnect()) { ! if (reconnectTime == 0) { ! StartConnect(); ! } ! else ! if (reconnectTime > 0) { ! if (!hReconnectTimer) ! hReconnectTimer = ::CreateWaitableTimer(NULL, FALSE, NULL); ! if (hReconnectTimer) { ! LARGE_INTEGER firstReportTime; ! firstReportTime.QuadPart = -10000LL * reconnectTime; ! if (!::SetWaitableTimer(hReconnectTimer, &firstReportTime, 0, TimerAPCProc, this, FALSE)) { ! DWORD err = GetLastError(); ! cerr << "WARNING: SetWaitableTimer() - error=" << err << endl; ! } ! } else { ! DWORD err = GetLastError(); ! cerr << "WARNING: CreateWaitableTimer() - error=" << err << endl; ! } } } } pOverlapped->Delete(); --- 438,500 ---- } ! void ComPort::OnDisconnect() { ! Close(hSock); ! hSock = INVALID_SOCKET; ! if (isConnected) { ! isConnected = FALSE; ! HUB_MSG msg; ! msg.type = HUB_MSG_TYPE_CONNECT; ! msg.u.val = FALSE; ! pOnRead(hHub, hMasterPort, &msg); ! } ! if (pListener) { ! pListener->push(this); ! } ! else ! if (CanConnect()) { ! if (reconnectTime == 0) { ! StartConnect(); ! } ! else ! if (reconnectTime > 0) { ! if (!hReconnectTimer) ! hReconnectTimer = ::CreateWaitableTimer(NULL, FALSE, NULL); ! if (hReconnectTimer) { ! LARGE_INTEGER firstReportTime; ! firstReportTime.QuadPart = -10000LL * reconnectTime; ! if (!::SetWaitableTimer(hReconnectTimer, &firstReportTime, 0, TimerAPCProc, this, FALSE)) { ! DWORD err = GetLastError(); ! cerr << "WARNING: SetWaitableTimer() - error=" << err << endl; } + } else { + DWORD err = GetLastError(); + + cerr << "WARNING: CreateWaitableTimer() - error=" << err << endl; } } + } + } + + BOOL ComPort::OnEvent(WaitEventOverlapped *pOverlapped, long e) + { + //cout << "ComPort::OnEvent " << name << " " << hex << e << dec << endl; + + _ASSERTE(hSock == pOverlapped->Sock()); + + if (e == FD_CLOSE) { + if (countReadOverlapped > 0) + isDisconnected = TRUE; + else + OnDisconnect(); pOverlapped->Delete(); *************** *** 493,502 **** else if (e == FD_CONNECT) { ! if (hSock == pOverlapped->Sock()) { ! OnConnect(); ! } else { ! pOverlapped->Delete(); ! return FALSE; ! } } --- 503,507 ---- else if (e == FD_CONNECT) { ! OnConnect(); } *************** *** 507,510 **** --- 512,516 ---- { _ASSERTE(isConnected == FALSE); + _ASSERTE(isDisconnected == FALSE); isConnected = TRUE; Index: comport.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comport.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** comport.h 13 Nov 2008 07:41:09 -0000 1.4 --- comport.h 17 Nov 2008 16:44:57 -0000 1.5 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.5 2008/11/17 16:44:57 vfrolov + * Fixed race conditions + * * Revision 1.4 2008/11/13 07:41:09 vfrolov * Changed for staticaly linking *************** *** 85,89 **** void OnWrite(WriteOverlapped *pOverlapped, DWORD len, DWORD done); void OnRead(ReadOverlapped *pOverlapped, BYTE *pBuf, DWORD done); ! BOOL OnEvent(WaitEventOverlapped *pOverlapped, long e, int err); void AddXoff(int count); void LostReport(); --- 88,92 ---- void OnWrite(WriteOverlapped *pOverlapped, DWORD len, DWORD done); void OnRead(ReadOverlapped *pOverlapped, BYTE *pBuf, DWORD done); ! BOOL OnEvent(WaitEventOverlapped *pOverlapped, long e); void AddXoff(int count); void LostReport(); *************** *** 100,103 **** --- 103,107 ---- BOOL StartWaitEvent(SOCKET hSockWait); void OnConnect(); + void OnDisconnect(); struct sockaddr_in snLocal; *************** *** 109,112 **** --- 113,117 ---- SOCKET hSock; BOOL isConnected; + BOOL isDisconnected; int connectionCounter; BOOL permanent; Index: comio.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comio.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** comio.h 22 Oct 2008 15:31:38 -0000 1.3 --- comio.h 17 Nov 2008 16:44:57 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.4 2008/11/17 16:44:57 vfrolov + * Fixed race conditions + * * Revision 1.3 2008/10/22 15:31:38 vfrolov * Fixed race condition *************** *** 44,47 **** --- 47,51 ---- extern SOCKET Accept(SOCKET hSockListen); extern void Disconnect(SOCKET hSock); + extern void Close(SOCKET hSock); /////////////////////////////////////////////////////////////// class ReadOverlapped : private OVERLAPPED Index: comio.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comio.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** comio.cpp 13 Nov 2008 07:41:09 -0000 1.5 --- comio.cpp 17 Nov 2008 16:44:57 -0000 1.6 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.6 2008/11/17 16:44:57 vfrolov + * Fixed race conditions + * * Revision 1.5 2008/11/13 07:41:09 vfrolov * Changed for staticaly linking *************** *** 121,125 **** if (err != WSAEWOULDBLOCK) { TraceError(err, "Connect(%x): connect()", hSock); - closesocket(hSock); return FALSE; } --- 124,127 ---- *************** *** 192,195 **** --- 194,208 ---- } /////////////////////////////////////////////////////////////// + void Close(SOCKET hSock) + { + if (hSock == INVALID_SOCKET) + return; + + if (closesocket(hSock) != 0) + TraceError(GetLastError(), "Close(): closesocket(%x)", hSock); + else + cout << "Close(" << hex << hSock << dec << ") - OK" << endl; + } + /////////////////////////////////////////////////////////////// WriteOverlapped::WriteOverlapped(ComPort &_port, BYTE *_pBuf, DWORD _len) : port(_port), *************** *** 350,365 **** void WaitEventOverlapped::Delete() { - if (hSock != INVALID_SOCKET) { - if (closesocket(hSock) != 0) { - TraceError( - GetLastError(), - "WaitEventOverlapped::~WaitEventOverlapped(): closesocket(%x) %s", - hSock, - port.Name().c_str()); - } - else - cout << "Close(" << hex << hSock << dec << ") - OK" << endl; - } - if (hWait != INVALID_HANDLE_VALUE) { if (!::UnregisterWait(hWait)) { --- 363,366 ---- *************** *** 412,415 **** --- 413,419 ---- if ((events.lNetworkEvents & FD_CONNECT) != 0) { + if (!pOver->port.OnEvent(pOver, FD_CONNECT)) + return; + if (events.iErrorCode[FD_CONNECT_BIT] != ERROR_SUCCESS) { TraceError( *************** *** 418,429 **** (long)pOver->hSock, pOver->port.Name().c_str()); - } ! if (!pOver->port.OnEvent(pOver, FD_CONNECT, events.iErrorCode[FD_CONNECT_BIT])) ! return; } if ((events.lNetworkEvents & FD_CLOSE) != 0) { ! if (!pOver->port.OnEvent(pOver, FD_CLOSE, events.iErrorCode[FD_CLOSE_BIT])) return; } --- 422,433 ---- (long)pOver->hSock, pOver->port.Name().c_str()); ! if (!pOver->port.OnEvent(pOver, FD_CLOSE)) ! return; ! } } if ((events.lNetworkEvents & FD_CLOSE) != 0) { ! if (!pOver->port.OnEvent(pOver, FD_CLOSE)) return; } |
From: Vyacheslav F. <vf...@us...> - 2008-11-14 15:30:10
|
Update of /cvsroot/com0com/hub4com In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31985 Modified Files: ReadMe.txt Log Message: Added more examples Index: ReadMe.txt =================================================================== RCS file: /cvsroot/com0com/hub4com/ReadMe.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ReadMe.txt 16 Apr 2007 07:31:35 -0000 1.3 --- ReadMe.txt 14 Nov 2008 15:29:57 -0000 1.4 *************** *** 20,24 **** ======== ! Start Microsoft Visual C++ 2005 with hub4com.vcproj file. Set Active Configuration to hub4com - Win32 Release. Build hub4com.exe. --- 20,24 ---- ======== ! Start Microsoft Visual C++ 2005 with hub4com.sln file. Set Active Configuration to hub4com - Win32 Release. Build hub4com.exe. *************** *** 41,53 **** ! EXAMPLE OF USAGE ! ================ ! You have serial device that connected to your computer via COM1 port and ! you'd like to handle its data by two applications. You can do it this way: ! 1. With the com0com driver create two virtual COM port pairs with ! port names CNCA0, CNCB0, CNCA1 and CNCB1 (see com0com's ReadMe.txt ! for details). 2. Start the hub4com.exe on COM1, CNCB0 and CNCB1 ports: --- 41,57 ---- ! EXAMPLES OF USAGE ! ================= ! You have a GPS device that connected to your computer via a phisical COM1 ! port and you'd like to handle its data by two GPS applications. You can ! do it this way: ! 1. With the com0com's Setup Command Prompt create COM5<->CNCB0 and ! COM6<->CNCB1 virtual COM port pairs (see com0com's ReadMe.txt for ! more info). For example: ! ! command> install 0 PortName=COM5 - ! command> install 1 PortName=COM6 - 2. Start the hub4com.exe on COM1, CNCB0 and CNCB1 ports: *************** *** 58,60 **** and it will send data received from CNCB0 port to COM1 port. ! 3. Start the applications on CNCA0 and CNCA1 ports. --- 62,115 ---- and it will send data received from CNCB0 port to COM1 port. ! 3. Start the GPS applications on COM5 and COM6 ports. ! ! --- ! ! You have old TERM95.EXE application from the Norton Commander 5.0 for ! MS-DOS and you'd like to use it to communicate with your.telnet.server ! telnet server. You can do so this way: ! ! 1. With the com0com's Setup Command Prompt create COM2<->CNCB0 virtual ! COM port pair (see com0com's ReadMe.txt for more info). For example: ! ! command> install 0 PortName=COM2 - ! ! 2. Start the com2tcp.bat on CNCB0 port. For example: ! ! com2tcp --telnet \\.\CNCB0 your.telnet.server telnet ! ! 3. Start the TERM95.EXE on COM2 port. ! ! BTW: com2tcp.bat is a wrapper to hub4com.exe. It works very similar to ! the "COM port to TCP redirector" (com2tcp). It supports all ! com2tcp's options. ! ! --- ! ! You have a phisical COM1 port and you'd like to share it through the ! network by the RFC 2217 "Telnet Com Port Control Option" protocol. ! ! 1. Start the com2tcp-rfc2217.bat on COM1 port. For example: ! ! com2tcp-rfc2217 COM1 7000 ! ! It will listen TCP/IP port 7000 for incaming connections and ! redirect them to COM1 port. ! ! --- ! ! On the first computer your.comport.server you have a phisical serial port ! shared through the network by the RFC 2217 protocol and you'd like to use ! it like a virtual serial port on the second computer. ! ! 1. With the com0com's Setup Command Prompt create COM5<->CNCB0 virtual ! COM port pair (see com0com's ReadMe.txt for more info). For example: ! ! command> install 0 PortName=COM5 - ! ! 2. Start the com2tcp-rfc2217.bat on CNCB0 port. For example: ! ! com2tcp-rfc2217 \\.\CNCB0 your.comport.server 7000 ! ! It will redirect virtual serial port COM5 on the second computer to the ! phisical serial port on the first computer. |
From: Vyacheslav F. <vf...@us...> - 2008-11-13 08:07:44
|
Update of /cvsroot/com0com/hub4com In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9667 Modified Files: comhub.cpp comhub.h export.cpp export.h filters.cpp filters.h hub4com.cpp hubmsg.cpp hubmsg.h plugins.cpp plugins.h port.cpp port.h Log Message: Changed for staticaly linking Index: port.h =================================================================== RCS file: /cvsroot/com0com/hub4com/port.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** port.h 15 Aug 2008 12:44:59 -0000 1.2 --- port.h 13 Nov 2008 08:07:40 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2008/11/13 08:07:40 vfrolov + * Changed for staticaly linking + * * Revision 1.2 2008/08/15 12:44:59 vfrolov * Added fake read filter method to ports *************** *** 31,36 **** #define _PORT_H - #include "plugins/plugins_api.h" - /////////////////////////////////////////////////////////////// class ComHub; --- 34,37 ---- Index: port.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/port.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** port.cpp 15 Aug 2008 12:44:59 -0000 1.2 --- port.cpp 13 Nov 2008 08:07:40 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2008/11/13 08:07:40 vfrolov + * Changed for staticaly linking + * * Revision 1.2 2008/08/15 12:44:59 vfrolov * Added fake read filter method to ports *************** *** 29,32 **** --- 32,37 ---- #include "precomp.h" + #include "plugins/plugins_api.h" + #include "port.h" #include "comhub.h" Index: export.h =================================================================== RCS file: /cvsroot/com0com/hub4com/export.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** export.h 26 Mar 2008 08:35:03 -0000 1.1 --- export.h 13 Nov 2008 08:07:40 -0000 1.2 *************** *** 20,27 **** * * $Log$ * Revision 1.1 2008/03/26 08:35:03 vfrolov * Initial revision * - * */ --- 20,29 ---- * * $Log$ + * Revision 1.2 2008/11/13 08:07:40 vfrolov + * Changed for staticaly linking + * * Revision 1.1 2008/03/26 08:35:03 vfrolov * Initial revision * */ *************** *** 29,34 **** #define _EXPORT_H - #include "plugins/plugins_api.h" - /////////////////////////////////////////////////////////////// extern HUB_ROUTINES_A hubRoutines; --- 31,34 ---- Index: export.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/export.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** export.cpp 16 Oct 2008 09:24:23 -0000 1.4 --- export.cpp 13 Nov 2008 08:07:40 -0000 1.5 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.5 2008/11/13 08:07:40 vfrolov + * Changed for staticaly linking + * * Revision 1.4 2008/10/16 09:24:23 vfrolov * Changed return type of ROUTINE_MSG_REPLACE_*() to BOOL *************** *** 35,38 **** --- 38,43 ---- #include "precomp.h" + #include "plugins/plugins_api.h" + #include "export.h" #include "port.h" Index: plugins.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** plugins.cpp 20 Aug 2008 09:38:52 -0000 1.3 --- plugins.cpp 13 Nov 2008 08:07:40 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.4 2008/11/13 08:07:40 vfrolov + * Changed for staticaly linking + * * Revision 1.3 2008/08/20 09:38:52 vfrolov * Fixed unknown types printing *************** *** 32,35 **** --- 35,40 ---- #include "precomp.h" + #include "plugins/plugins_api.h" + #include "port.h" #include "comhub.h" *************** *** 38,46 **** #include "hubmsg.h" #include "export.h" /////////////////////////////////////////////////////////////// class PluginEnt { public: ! PluginEnt(const PLUGIN_ROUTINES_A *_pRoutines); ~PluginEnt(); --- 43,52 ---- #include "hubmsg.h" #include "export.h" + #include "static.h" /////////////////////////////////////////////////////////////// class PluginEnt { public: ! PluginEnt(const PLUGIN_ROUTINES_A *_pRoutines, HMODULE _hDll); ~PluginEnt(); *************** *** 72,84 **** BOOL InUse() const { return inUse; } private: const PLUGIN_ROUTINES_A *pRoutines; BOOL inUse; HCONFIG hConfig; }; ! PluginEnt::PluginEnt(const PLUGIN_ROUTINES_A *_pRoutines) : pRoutines(_pRoutines), inUse(FALSE), hConfig(NULL) --- 78,93 ---- BOOL InUse() const { return inUse; } + HMODULE Dll() const { return hDll; } private: const PLUGIN_ROUTINES_A *pRoutines; + HMODULE hDll; BOOL inUse; HCONFIG hConfig; }; ! PluginEnt::PluginEnt(const PLUGIN_ROUTINES_A *_pRoutines, HMODULE _hDll) : pRoutines(_pRoutines), + hDll(_hDll), inUse(FALSE), hConfig(NULL) *************** *** 123,140 **** } /////////////////////////////////////////////////////////////// ! static BOOL GetPluginsDir(string &pluginsDir) { DWORD res; char *pPath1 = new char[MAX_PATH]; if (!pPath1) { ! return FALSE; } ! res = GetModuleFileName(NULL, pPath1, MAX_PATH); if (!res || res >= MAX_PATH) { delete [] pPath1; ! return FALSE; } --- 132,150 ---- } /////////////////////////////////////////////////////////////// ! static string GetModulePath(HMODULE hDll, BOOL withName) { + string path; DWORD res; char *pPath1 = new char[MAX_PATH]; if (!pPath1) { ! return path; } ! res = GetModuleFileName(hDll, pPath1, MAX_PATH); if (!res || res >= MAX_PATH) { delete [] pPath1; ! return path; } *************** *** 143,147 **** if (!pPath2) { delete [] pPath1; ! return FALSE; } --- 153,157 ---- if (!pPath2) { delete [] pPath1; ! return path; } *************** *** 154,178 **** if (!res || res >= MAX_PATH || !pName) { delete [] pPath2; ! return FALSE; } ! *pName = 0; ! pluginsDir = pPath2; delete [] pPath2; ! pluginsDir += "plugins\\"; ! ! return TRUE; } /////////////////////////////////////////////////////////////// Plugins::Plugins() { ! string pluginsDir; ! if (!GetPluginsDir(pluginsDir)) ! return; string pathWildcard(pluginsDir); --- 164,195 ---- if (!res || res >= MAX_PATH || !pName) { delete [] pPath2; ! return path; } ! if (!withName) ! *pName = 0; ! path = pPath2; delete [] pPath2; ! return path; } /////////////////////////////////////////////////////////////// Plugins::Plugins() { ! DllPlugins *pDllPlugins = new DllPlugins(NULL, new PluginArray); ! for (PLUGIN_INIT_A *const *pList = GetStaticInitList() ; *pList ; pList++) ! InitPlugin(NULL, *pList, *pDllPlugins->second); + if (pDllPlugins->second->size()) { + dllPluginsArray.push_back(pDllPlugins); + } else { + delete pDllPlugins->second; + delete pDllPlugins; + } + + string pluginsDir = GetModulePath(NULL, FALSE) + "plugins\\"; string pathWildcard(pluginsDir); *************** *** 276,280 **** } ! InitPlugin(pathPlugin, pInitProc, *pDllPlugins->second); if (pDllPlugins->second->size()) { --- 293,297 ---- } ! InitPlugin(hDll, pInitProc, *pDllPlugins->second); if (pDllPlugins->second->size()) { *************** *** 288,292 **** /////////////////////////////////////////////////////////////// void Plugins::InitPlugin( ! const string &moduleName, PLUGIN_INIT_A *pInitProc, PluginArray &pluginArray) --- 305,309 ---- /////////////////////////////////////////////////////////////// void Plugins::InitPlugin( ! HMODULE hDll, PLUGIN_INIT_A *pInitProc, PluginArray &pluginArray) *************** *** 301,309 **** if (type == PLUGIN_TYPE_INVALID) { ! cerr << "Found plugin with invalid type in " << moduleName << endl; continue; } ! PluginEnt *pPlugin = new PluginEnt(*ppPlgRoutines); if (!pPlugin) { --- 318,326 ---- if (type == PLUGIN_TYPE_INVALID) { ! cerr << "Found module with invalid type in " << GetModulePath(hDll, TRUE) << endl; continue; } ! PluginEnt *pPlugin = new PluginEnt(*ppPlgRoutines, hDll); if (!pPlugin) { *************** *** 320,324 **** if (iPair == plugins.end()) { ! cerr << "Can't add plugin type " << type << endl; delete pPlugin; continue; --- 337,341 ---- if (iPair == plugins.end()) { ! cerr << "Can't add module type " << type2str(type) << endl; delete pPlugin; continue; *************** *** 336,353 **** } ! for (PluginArray::const_iterator i = iPair->second->begin() ; i != iPair->second->end() ; i++) { if (*i && (*i)->Name() == pPlugin->Name()) { cerr ! << "Plugin " << pPlugin->Name() << " with type " << type ! << " already exists. Ignored plugin in " << moduleName << endl; ! delete pPlugin; ! pPlugin = NULL; } } ! if (pPlugin) { ! iPair->second->push_back(pPlugin); ! pluginArray.push_back(pPlugin); ! } } } --- 353,369 ---- } ! for (PluginArray::iterator i = iPair->second->begin() ; i != iPair->second->end() ; i++) { if (*i && (*i)->Name() == pPlugin->Name()) { cerr ! << "Module " << pPlugin->Name() << " with type " << type2str(type) << " in" << endl ! << " " << GetModulePath((*i)->Dll(), TRUE) << endl ! << "replaced by module in" << endl ! << " " << GetModulePath(hDll, TRUE) << endl; ! *i = NULL; } } ! iPair->second->push_back(pPlugin); ! pluginArray.push_back(pPlugin); } } *************** *** 360,365 **** o << "List of " << type2str(iPair->first) << " modules:" << endl; ! for (PluginArray::const_iterator i = iPair->second->begin() ; i != iPair->second->end() ; i++) ! o << " " << (*i)->Name() << " - " << (*i)->Description() << endl; } } --- 376,383 ---- o << "List of " << type2str(iPair->first) << " modules:" << endl; ! for (PluginArray::const_iterator i = iPair->second->begin() ; i != iPair->second->end() ; i++) { ! if (*i) ! o << " " << (*i)->Name() << " - " << (*i)->Description() << endl; ! } } } *************** *** 384,387 **** --- 402,406 ---- cerr << "License: " << (*i)->License() << endl; cerr << "Description: " << (*i)->Description() << endl; + cerr << "File: " << GetModulePath((*i)->Dll(), TRUE) << endl; cerr << endl; (*i)->Help(pProgPath); *************** *** 394,398 **** if (!found) ! cerr << "The plugin " << pPluginName << " not found." << endl; } /////////////////////////////////////////////////////////////// --- 413,417 ---- if (!found) ! cerr << "The module " << pPluginName << " not found." << endl; } /////////////////////////////////////////////////////////////// Index: comhub.h =================================================================== RCS file: /cvsroot/com0com/hub4com/comhub.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** comhub.h 20 Aug 2008 08:46:06 -0000 1.7 --- comhub.h 13 Nov 2008 08:07:40 -0000 1.8 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.8 2008/11/13 08:07:40 vfrolov + * Changed for staticaly linking + * * Revision 1.7 2008/08/20 08:46:06 vfrolov * Implemented ComHub::FilterName() *************** *** 46,51 **** #define _COMHUB_H - #include "plugins/plugins_api.h" - /////////////////////////////////////////////////////////////// class Port; --- 49,52 ---- Index: comhub.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/comhub.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** comhub.cpp 20 Aug 2008 14:30:18 -0000 1.9 --- comhub.cpp 13 Nov 2008 08:07:40 -0000 1.10 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.10 2008/11/13 08:07:40 vfrolov + * Changed for staticaly linking + * * Revision 1.9 2008/08/20 14:30:18 vfrolov * Redesigned serial port options *************** *** 57,60 **** --- 60,65 ---- #include "precomp.h" + #include "plugins/plugins_api.h" + #include "comhub.h" #include "port.h" Index: hubmsg.h =================================================================== RCS file: /cvsroot/com0com/hub4com/hubmsg.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hubmsg.h 26 Mar 2008 08:36:03 -0000 1.1 --- hubmsg.h 13 Nov 2008 08:07:40 -0000 1.2 *************** *** 20,27 **** * * $Log$ * Revision 1.1 2008/03/26 08:36:03 vfrolov * Initial revision * - * */ --- 20,29 ---- * * $Log$ + * Revision 1.2 2008/11/13 08:07:40 vfrolov + * Changed for staticaly linking + * * Revision 1.1 2008/03/26 08:36:03 vfrolov * Initial revision * */ *************** *** 30,35 **** /////////////////////////////////////////////////////////////// - #include "plugins/plugins_api.h" - /////////////////////////////////////////////////////////////// #define MSG_SIGNATURE 'h4cM' /////////////////////////////////////////////////////////////// --- 32,35 ---- Index: hubmsg.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/hubmsg.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hubmsg.cpp 26 Mar 2008 08:36:03 -0000 1.1 --- hubmsg.cpp 13 Nov 2008 08:07:40 -0000 1.2 *************** *** 20,30 **** * * $Log$ * Revision 1.1 2008/03/26 08:36:03 vfrolov * Initial revision * - * */ #include "precomp.h" #include "hubmsg.h" #include "bufutils.h" --- 20,34 ---- * * $Log$ + * Revision 1.2 2008/11/13 08:07:40 vfrolov + * Changed for staticaly linking + * * Revision 1.1 2008/03/26 08:36:03 vfrolov * Initial revision * */ #include "precomp.h" + #include "plugins/plugins_api.h" + #include "hubmsg.h" #include "bufutils.h" Index: filters.h =================================================================== RCS file: /cvsroot/com0com/hub4com/filters.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** filters.h 16 Oct 2008 06:19:12 -0000 1.5 --- filters.h 13 Nov 2008 08:07:40 -0000 1.6 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.6 2008/11/13 08:07:40 vfrolov + * Changed for staticaly linking + * * Revision 1.5 2008/10/16 06:19:12 vfrolov * Divided filter ID to filter group ID and filter name *************** *** 40,45 **** #define _FILTERS_H - #include "plugins/plugins_api.h" - /////////////////////////////////////////////////////////////// class ComHub; --- 43,46 ---- Index: hub4com.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/hub4com.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** hub4com.cpp 16 Oct 2008 06:19:12 -0000 1.16 --- hub4com.cpp 13 Nov 2008 08:07:40 -0000 1.17 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.17 2008/11/13 08:07:40 vfrolov + * Changed for staticaly linking + * * Revision 1.16 2008/10/16 06:19:12 vfrolov * Divided filter ID to filter group ID and filter name *************** *** 73,76 **** --- 76,81 ---- #include "precomp.h" + #include "plugins/plugins_api.h" + #include "comhub.h" #include "filters.h" Index: plugins.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** plugins.h 26 Mar 2008 08:36:25 -0000 1.1 --- plugins.h 13 Nov 2008 08:07:40 -0000 1.2 *************** *** 20,27 **** * * $Log$ * Revision 1.1 2008/03/26 08:36:25 vfrolov * Initial revision * - * */ --- 20,29 ---- * * $Log$ + * Revision 1.2 2008/11/13 08:07:40 vfrolov + * Changed for staticaly linking + * * Revision 1.1 2008/03/26 08:36:25 vfrolov * Initial revision * */ *************** *** 29,34 **** #define _PLUGINS_H - #include "plugins/plugins_api.h" - /////////////////////////////////////////////////////////////// class PluginEnt; --- 31,34 ---- *************** *** 58,62 **** void LoadPlugin(const string &pathPlugin); void InitPlugin( ! const string &moduleName, PLUGIN_INIT_A *pInitProc, PluginArray &pluginArray); --- 58,62 ---- void LoadPlugin(const string &pathPlugin); void InitPlugin( ! HMODULE hDll, PLUGIN_INIT_A *pInitProc, PluginArray &pluginArray); Index: filters.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/filters.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** filters.cpp 16 Oct 2008 06:19:12 -0000 1.5 --- filters.cpp 13 Nov 2008 08:07:40 -0000 1.6 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.6 2008/11/13 08:07:40 vfrolov + * Changed for staticaly linking + * * Revision 1.5 2008/10/16 06:19:12 vfrolov * Divided filter ID to filter group ID and filter name *************** *** 38,41 **** --- 41,46 ---- #include "precomp.h" + #include "plugins/plugins_api.h" + #include "port.h" #include "comhub.h" |
From: Vyacheslav F. <vf...@us...> - 2008-11-13 08:04:41
|
Update of /cvsroot/com0com/hub4com In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9252 Modified Files: hub4com.vcproj Log Message: Added static.h and static.cpp Index: hub4com.vcproj =================================================================== RCS file: /cvsroot/com0com/hub4com/hub4com.vcproj,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** hub4com.vcproj 24 Oct 2008 09:02:15 -0000 1.6 --- hub4com.vcproj 13 Nov 2008 08:04:37 -0000 1.7 *************** *** 219,222 **** --- 219,226 ---- </File> <File + RelativePath=".\static.h" + > + </File> + <File RelativePath=".\utils.h" > *************** *** 295,298 **** --- 299,306 ---- </File> <File + RelativePath=".\static.cpp" + > + </File> + <File RelativePath=".\utils.cpp" > |
From: Vyacheslav F. <vf...@us...> - 2008-11-13 08:03:28
|
Update of /cvsroot/com0com/hub4com In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9014 Added Files: static.cpp static.h Log Message: Initial revision --- NEW FILE: static.h --- /* * $Id: static.h,v 1.1 2008/11/13 08:03:24 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: static.h,v $ * Revision 1.1 2008/11/13 08:03:24 vfrolov * Initial revision * */ #ifndef _STATIC_H #define _STATIC_H /////////////////////////////////////////////////////////////// PLUGIN_INIT_A *const *GetStaticInitList(); /////////////////////////////////////////////////////////////// #endif // _STATIC_H --- NEW FILE: static.cpp --- /* * $Id: static.cpp,v 1.1 2008/11/13 08:03:24 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: static.cpp,v $ * Revision 1.1 2008/11/13 08:03:24 vfrolov * Initial revision * */ #include "precomp.h" #include "plugins/plugins_api.h" #include "static.h" /////////////////////////////////////////////////////////////// #ifdef USE_STATIC_PLUGINS #define INIT_DECLARE(ns) namespace ns {PLUGIN_INIT_A InitA;} #define INIT_INSERT(ns) ns::InitA, #else #define INIT_DECLARE(ns) #define INIT_INSERT(ns) #endif /////////////////////////////////////////////////////////////// INIT_DECLARE(FilterAwakSeq) INIT_DECLARE(FilterEcho) INIT_DECLARE(FilterEscInsert) INIT_DECLARE(FilterEscParse) INIT_DECLARE(FilterLineCtl) INIT_DECLARE(FilterLsrMap) INIT_DECLARE(FilterPin2Con) INIT_DECLARE(FilterPinMap) INIT_DECLARE(FilterTelnet) INIT_DECLARE(FilterTrace) INIT_DECLARE(PortSerial) INIT_DECLARE(PortTcp) /////////////////////////////////////////////////////////////// static PLUGIN_INIT_A *const list[] = { INIT_INSERT(FilterAwakSeq) INIT_INSERT(FilterEcho) INIT_INSERT(FilterEscInsert) INIT_INSERT(FilterEscParse) INIT_INSERT(FilterLineCtl) INIT_INSERT(FilterLsrMap) INIT_INSERT(FilterPin2Con) INIT_INSERT(FilterPinMap) INIT_INSERT(FilterTelnet) INIT_INSERT(FilterTrace) INIT_INSERT(PortSerial) INIT_INSERT(PortTcp) NULL, }; /////////////////////////////////////////////////////////////// PLUGIN_INIT_A *const *GetStaticInitList() { return list; } /////////////////////////////////////////////////////////////// |
From: Vyacheslav F. <vf...@us...> - 2008-11-13 07:52:24
|
Update of /cvsroot/com0com/hub4com/plugins/trace In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7747 Modified Files: filter.cpp Log Message: Changed for staticaly linking Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/trace/filter.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** filter.cpp 12 Nov 2008 08:46:39 -0000 1.7 --- filter.cpp 13 Nov 2008 07:52:20 -0000 1.8 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.8 2008/11/13 07:52:20 vfrolov + * Changed for staticaly linking + * * Revision 1.7 2008/11/12 08:46:39 vfrolov * Fixed TYPE_LC and SET_LSR tracing *************** *** 49,53 **** #include "precomp.h" #include "../plugins_api.h" ! /////////////////////////////////////////////////////////////// #ifndef _DEBUG --- 52,57 ---- #include "precomp.h" #include "../plugins_api.h" ! /////////////////////////////////////////////////////////////// ! namespace FilterTrace { /////////////////////////////////////////////////////////////// #ifndef _DEBUG *************** *** 769,770 **** --- 773,776 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// |
From: Vyacheslav F. <vf...@us...> - 2008-11-13 07:51:37
|
Update of /cvsroot/com0com/hub4com/plugins/pinmap In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7616 Modified Files: filter.cpp Log Message: Changed for staticaly linking Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/pinmap/filter.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** filter.cpp 16 Oct 2008 06:49:58 -0000 1.10 --- filter.cpp 13 Nov 2008 07:51:34 -0000 1.11 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.11 2008/11/13 07:51:34 vfrolov + * Changed for staticaly linking + * * Revision 1.10 2008/10/16 06:49:58 vfrolov * Added wiring to DCE's output pins *************** *** 57,61 **** #include "precomp.h" #include "../plugins_api.h" ! /////////////////////////////////////////////////////////////// static ROUTINE_MSG_INSERT_VAL *pMsgInsertVal = NULL; --- 60,65 ---- #include "precomp.h" #include "../plugins_api.h" ! /////////////////////////////////////////////////////////////// ! namespace FilterPinMap { /////////////////////////////////////////////////////////////// static ROUTINE_MSG_INSERT_VAL *pMsgInsertVal = NULL; *************** *** 528,529 **** --- 532,535 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// |
From: Vyacheslav F. <vf...@us...> - 2008-11-13 07:50:50
|
Update of /cvsroot/com0com/hub4com/plugins/pin2con In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7390 Modified Files: filter.cpp Log Message: Changed for staticaly linking Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/pin2con/filter.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** filter.cpp 16 Oct 2008 09:24:23 -0000 1.10 --- filter.cpp 13 Nov 2008 07:50:41 -0000 1.11 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.11 2008/11/13 07:50:41 vfrolov + * Changed for staticaly linking + * * Revision 1.10 2008/10/16 09:24:23 vfrolov * Changed return type of ROUTINE_MSG_REPLACE_*() to BOOL *************** *** 65,69 **** #include "precomp.h" #include "../plugins_api.h" ! /////////////////////////////////////////////////////////////// static ROUTINE_MSG_INSERT_VAL *pMsgInsertVal = NULL; --- 68,73 ---- #include "precomp.h" #include "../plugins_api.h" ! /////////////////////////////////////////////////////////////// ! namespace FilterPin2Con { /////////////////////////////////////////////////////////////// static ROUTINE_MSG_INSERT_VAL *pMsgInsertVal = NULL; *************** *** 359,360 **** --- 363,366 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// |
From: Vyacheslav F. <vf...@us...> - 2008-11-13 07:49:56
|
Update of /cvsroot/com0com/hub4com/plugins/lsrmap In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7231 Modified Files: filter.cpp Log Message: Changed for staticaly linking Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/lsrmap/filter.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** filter.cpp 16 Oct 2008 07:05:53 -0000 1.1 --- filter.cpp 13 Nov 2008 07:49:45 -0000 1.2 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.2 2008/11/13 07:49:45 vfrolov + * Changed for staticaly linking + * * Revision 1.1 2008/10/16 07:05:53 vfrolov * Initial revision *************** *** 27,31 **** #include "precomp.h" #include "../plugins_api.h" ! /////////////////////////////////////////////////////////////// static ROUTINE_MSG_INSERT_VAL *pMsgInsertVal; --- 30,35 ---- #include "precomp.h" #include "../plugins_api.h" ! /////////////////////////////////////////////////////////////// ! namespace FilterLsrMap { /////////////////////////////////////////////////////////////// static ROUTINE_MSG_INSERT_VAL *pMsgInsertVal; *************** *** 231,232 **** --- 235,238 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// |
From: Vyacheslav F. <vf...@us...> - 2008-11-13 07:48:40
|
Update of /cvsroot/com0com/hub4com/plugins/linectl In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6989 Modified Files: filter.cpp Log Message: Changed for staticaly linking Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/linectl/filter.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** filter.cpp 22 Oct 2008 08:27:26 -0000 1.5 --- filter.cpp 13 Nov 2008 07:48:35 -0000 1.6 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.6 2008/11/13 07:48:35 vfrolov + * Changed for staticaly linking + * * Revision 1.5 2008/10/22 08:27:26 vfrolov * Added ability to set bytesize, parity and stopbits separately *************** *** 39,43 **** #include "precomp.h" #include "../plugins_api.h" ! /////////////////////////////////////////////////////////////// static ROUTINE_MSG_INSERT_VAL *pMsgInsertVal = NULL; --- 42,47 ---- #include "precomp.h" #include "../plugins_api.h" ! /////////////////////////////////////////////////////////////// ! namespace FilterLineCtl { /////////////////////////////////////////////////////////////// static ROUTINE_MSG_INSERT_VAL *pMsgInsertVal = NULL; *************** *** 347,348 **** --- 351,354 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// |
From: Vyacheslav F. <vf...@us...> - 2008-11-13 07:47:52
|
Update of /cvsroot/com0com/hub4com/plugins/escparse In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6865 Modified Files: filter.cpp Log Message: Changed for staticaly linking Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/escparse/filter.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** filter.cpp 22 Oct 2008 08:27:26 -0000 1.5 --- filter.cpp 13 Nov 2008 07:47:48 -0000 1.6 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.6 2008/11/13 07:47:48 vfrolov + * Changed for staticaly linking + * * Revision 1.5 2008/10/22 08:27:26 vfrolov * Added ability to set bytesize, parity and stopbits separately *************** *** 43,47 **** #include "../plugins_api.h" #include "../cncext.h" ! /////////////////////////////////////////////////////////////// #ifndef _DEBUG --- 46,51 ---- #include "../plugins_api.h" #include "../cncext.h" ! /////////////////////////////////////////////////////////////// ! namespace FilterEscParse { /////////////////////////////////////////////////////////////// #ifndef _DEBUG *************** *** 700,701 **** --- 704,707 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// |
From: Vyacheslav F. <vf...@us...> - 2008-11-13 07:47:09
|
Update of /cvsroot/com0com/hub4com/plugins/escinsert In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6735 Modified Files: filter.cpp Log Message: Changed for staticaly linking Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/escinsert/filter.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** filter.cpp 22 Oct 2008 08:27:26 -0000 1.4 --- filter.cpp 13 Nov 2008 07:46:58 -0000 1.5 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.5 2008/11/13 07:46:58 vfrolov + * Changed for staticaly linking + * * Revision 1.4 2008/10/22 08:27:26 vfrolov * Added ability to set bytesize, parity and stopbits separately *************** *** 37,41 **** #include "../plugins_api.h" #include "../cncext.h" ! /////////////////////////////////////////////////////////////// static ROUTINE_MSG_INSERT_BUF *pMsgInsertBuf; --- 40,45 ---- #include "../plugins_api.h" #include "../cncext.h" ! /////////////////////////////////////////////////////////////// ! namespace FilterEscInsert { /////////////////////////////////////////////////////////////// static ROUTINE_MSG_INSERT_BUF *pMsgInsertBuf; *************** *** 533,534 **** --- 537,540 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// |
From: Vyacheslav F. <vf...@us...> - 2008-11-13 07:46:09
|
Update of /cvsroot/com0com/hub4com/plugins/echo In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6595 Modified Files: filter.cpp Log Message: Changed for staticaly linking Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/echo/filter.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** filter.cpp 2 Oct 2008 07:59:37 -0000 1.2 --- filter.cpp 13 Nov 2008 07:45:58 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2008/11/13 07:45:58 vfrolov + * Changed for staticaly linking + * * Revision 1.2 2008/10/02 07:59:37 vfrolov * Changed example *************** *** 30,34 **** #include "precomp.h" #include "../plugins_api.h" ! /////////////////////////////////////////////////////////////// #ifndef _DEBUG --- 33,38 ---- #include "precomp.h" #include "../plugins_api.h" ! /////////////////////////////////////////////////////////////// ! namespace FilterEcho { /////////////////////////////////////////////////////////////// #ifndef _DEBUG *************** *** 154,155 **** --- 158,161 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// |
From: Vyacheslav F. <vf...@us...> - 2008-11-13 07:45:19
|
Update of /cvsroot/com0com/hub4com/plugins/awakseq In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6496 Modified Files: filter.cpp Log Message: Changed for staticaly linking Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/awakseq/filter.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** filter.cpp 16 Oct 2008 09:24:23 -0000 1.7 --- filter.cpp 13 Nov 2008 07:45:07 -0000 1.8 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.8 2008/11/13 07:45:07 vfrolov + * Changed for staticaly linking + * * Revision 1.7 2008/10/16 09:24:23 vfrolov * Changed return type of ROUTINE_MSG_REPLACE_*() to BOOL *************** *** 45,49 **** #include "precomp.h" #include "../plugins_api.h" ! /////////////////////////////////////////////////////////////// #ifndef _DEBUG --- 48,53 ---- #include "precomp.h" #include "../plugins_api.h" ! /////////////////////////////////////////////////////////////// ! namespace FilterAwakSeq { /////////////////////////////////////////////////////////////// #ifndef _DEBUG *************** *** 368,369 **** --- 372,375 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// |
From: Vyacheslav F. <vf...@us...> - 2008-11-13 07:44:17
|
Update of /cvsroot/com0com/hub4com/plugins/telnet In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6364 Modified Files: opt_termtype.cpp telnet.cpp telnet.h opt_comport.cpp import.h filter.cpp Log Message: Changed for staticaly linking Index: opt_termtype.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/telnet/opt_termtype.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** opt_termtype.cpp 24 Oct 2008 06:51:23 -0000 1.1 --- opt_termtype.cpp 13 Nov 2008 07:44:12 -0000 1.2 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.2 2008/11/13 07:44:12 vfrolov + * Changed for staticaly linking + * * Revision 1.1 2008/10/24 06:51:23 vfrolov * Initial revision *************** *** 26,31 **** #include "precomp.h" #include "opt_termtype.h" - /////////////////////////////////////////////////////////////// enum { --- 29,37 ---- #include "precomp.h" + #include "../plugins_api.h" + /////////////////////////////////////////////////////////////// + namespace FilterTelnet { + /////////////////////////////////////////////////////////////// #include "opt_termtype.h" /////////////////////////////////////////////////////////////// enum { *************** *** 70,71 **** --- 76,79 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// Index: telnet.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/telnet/telnet.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** telnet.h 24 Oct 2008 08:29:01 -0000 1.3 --- telnet.h 13 Nov 2008 07:44:12 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.4 2008/11/13 07:44:12 vfrolov + * Changed for staticaly linking + * * Revision 1.3 2008/10/24 08:29:01 vfrolov * Implemented RFC 2217 *************** *** 34,39 **** #define _TELNET_H - #include "../plugins_api.h" - /////////////////////////////////////////////////////////////// typedef vector<BYTE> BYTE_vector; --- 37,40 ---- Index: telnet.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/telnet/telnet.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** telnet.cpp 24 Oct 2008 08:29:01 -0000 1.4 --- telnet.cpp 13 Nov 2008 07:44:12 -0000 1.5 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.5 2008/11/13 07:44:12 vfrolov + * Changed for staticaly linking + * * Revision 1.4 2008/10/24 08:29:01 vfrolov * Implemented RFC 2217 *************** *** 35,41 **** #include "precomp.h" #include "import.h" #include "telnet.h" - /////////////////////////////////////////////////////////////// static const char *code2name(unsigned code) --- 38,47 ---- #include "precomp.h" + #include "../plugins_api.h" + /////////////////////////////////////////////////////////////// + namespace FilterTelnet { + /////////////////////////////////////////////////////////////// #include "import.h" #include "telnet.h" /////////////////////////////////////////////////////////////// static const char *code2name(unsigned code) *************** *** 335,336 **** --- 341,344 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/telnet/filter.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** filter.cpp 24 Oct 2008 08:29:01 -0000 1.5 --- filter.cpp 13 Nov 2008 07:44:13 -0000 1.6 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.6 2008/11/13 07:44:13 vfrolov + * Changed for staticaly linking + * * Revision 1.5 2008/10/24 08:29:01 vfrolov * Implemented RFC 2217 *************** *** 38,45 **** #include "precomp.h" #include "import.h" #include "opt_termtype.h" #include "opt_comport.h" - /////////////////////////////////////////////////////////////// static ROUTINE_MSG_INSERT_NONE *pMsgInsertNone; --- 41,51 ---- #include "precomp.h" + #include "../plugins_api.h" + /////////////////////////////////////////////////////////////// + namespace FilterTelnet { + /////////////////////////////////////////////////////////////// #include "import.h" #include "opt_termtype.h" #include "opt_comport.h" /////////////////////////////////////////////////////////////// static ROUTINE_MSG_INSERT_NONE *pMsgInsertNone; *************** *** 787,788 **** --- 793,796 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// Index: import.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/telnet/import.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** import.h 24 Oct 2008 08:29:01 -0000 1.2 --- import.h 13 Nov 2008 07:44:12 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2008/11/13 07:44:12 vfrolov + * Changed for staticaly linking + * * Revision 1.2 2008/10/24 08:29:01 vfrolov * Implemented RFC 2217 *************** *** 31,36 **** #define _IMPORT_H - #include "../plugins_api.h" - /////////////////////////////////////////////////////////////// extern ROUTINE_MSG_INSERT_VAL *pMsgInsertVal; --- 34,37 ---- Index: opt_comport.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/telnet/opt_comport.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** opt_comport.cpp 24 Oct 2008 06:51:23 -0000 1.1 --- opt_comport.cpp 13 Nov 2008 07:44:12 -0000 1.2 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.2 2008/11/13 07:44:12 vfrolov + * Changed for staticaly linking + * * Revision 1.1 2008/10/24 06:51:23 vfrolov * Initial revision *************** *** 26,32 **** #include "precomp.h" #include "import.h" #include "opt_comport.h" - /////////////////////////////////////////////////////////////// enum { --- 29,38 ---- #include "precomp.h" + #include "../plugins_api.h" + /////////////////////////////////////////////////////////////// + namespace FilterTelnet { + /////////////////////////////////////////////////////////////// #include "import.h" #include "opt_comport.h" /////////////////////////////////////////////////////////////// enum { *************** *** 771,772 **** --- 777,780 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// |
From: Vyacheslav F. <vf...@us...> - 2008-11-13 07:41:13
|
Update of /cvsroot/com0com/hub4com/plugins/tcp In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5992 Modified Files: comio.cpp comparams.cpp comport.cpp comport.h import.h port.cpp Log Message: Changed for staticaly linking Index: comport.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comport.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** comport.cpp 22 Oct 2008 15:31:38 -0000 1.6 --- comport.cpp 13 Nov 2008 07:41:09 -0000 1.7 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.7 2008/11/13 07:41:09 vfrolov + * Changed for staticaly linking + * * Revision 1.6 2008/10/22 15:31:38 vfrolov * Fixed race condition *************** *** 41,49 **** #include "precomp.h" #include "comport.h" #include "comio.h" #include "comparams.h" #include "import.h" - /////////////////////////////////////////////////////////////// Listener::Listener(const struct sockaddr_in &_snLocal) --- 44,55 ---- #include "precomp.h" + #include "../plugins_api.h" + /////////////////////////////////////////////////////////////// + namespace PortTcp { + /////////////////////////////////////////////////////////////// #include "comport.h" #include "comio.h" #include "comparams.h" #include "import.h" /////////////////////////////////////////////////////////////// Listener::Listener(const struct sockaddr_in &_snLocal) *************** *** 100,104 **** SOCKET Listener::Accept() { ! return ::Accept(hSockListen); } /////////////////////////////////////////////////////////////// --- 106,110 ---- SOCKET Listener::Accept() { ! return PortTcp::Accept(hSockListen); } /////////////////////////////////////////////////////////////// *************** *** 551,552 **** --- 557,560 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// Index: comparams.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comparams.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** comparams.cpp 6 Oct 2008 12:15:14 -0000 1.2 --- comparams.cpp 13 Nov 2008 07:41:09 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2008/11/13 07:41:09 vfrolov + * Changed for staticaly linking + * * Revision 1.2 2008/10/06 12:15:14 vfrolov * Added --reconnect option *************** *** 29,34 **** #include "precomp.h" #include "comparams.h" - /////////////////////////////////////////////////////////////// ComParams::ComParams() --- 32,39 ---- #include "precomp.h" + /////////////////////////////////////////////////////////////// + namespace PortTcp { + /////////////////////////////////////////////////////////////// #include "comparams.h" /////////////////////////////////////////////////////////////// ComParams::ComParams() *************** *** 54,55 **** --- 59,62 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// Index: port.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/port.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** port.cpp 6 Oct 2008 12:15:14 -0000 1.6 --- port.cpp 13 Nov 2008 07:41:09 -0000 1.7 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.7 2008/11/13 07:41:09 vfrolov + * Changed for staticaly linking + * * Revision 1.6 2008/10/06 12:15:14 vfrolov * Added --reconnect option *************** *** 41,48 **** #include "precomp.h" #include "comparams.h" #include "comport.h" #include "import.h" - /////////////////////////////////////////////////////////////// static const char *GetParam(const char *pArg, const char *pPattern) --- 44,54 ---- #include "precomp.h" + #include "../plugins_api.h" + /////////////////////////////////////////////////////////////// + namespace PortTcp { + /////////////////////////////////////////////////////////////// #include "comparams.h" #include "comport.h" #include "import.h" /////////////////////////////////////////////////////////////// static const char *GetParam(const char *pArg, const char *pPattern) *************** *** 337,338 **** --- 343,346 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// Index: comport.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comport.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** comport.h 6 Oct 2008 12:15:14 -0000 1.3 --- comport.h 13 Nov 2008 07:41:09 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.4 2008/11/13 07:41:09 vfrolov + * Changed for staticaly linking + * * Revision 1.3 2008/10/06 12:15:14 vfrolov * Added --reconnect option *************** *** 34,39 **** #define _COMPORT_H - #include "../plugins_api.h" - /////////////////////////////////////////////////////////////// class ComParams; --- 37,40 ---- Index: import.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/import.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** import.h 27 Mar 2008 17:19:18 -0000 1.1 --- import.h 13 Nov 2008 07:41:09 -0000 1.2 *************** *** 20,27 **** * * $Log$ * Revision 1.1 2008/03/27 17:19:18 vfrolov * Initial revision * - * */ --- 20,29 ---- * * $Log$ + * Revision 1.2 2008/11/13 07:41:09 vfrolov + * Changed for staticaly linking + * * Revision 1.1 2008/03/27 17:19:18 vfrolov * Initial revision * */ *************** *** 29,34 **** #define _IMPORT_H - #include "../plugins_api.h" - /////////////////////////////////////////////////////////////// extern ROUTINE_BUF_ALLOC *pBufAlloc; --- 31,34 ---- Index: comio.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comio.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** comio.cpp 22 Oct 2008 15:31:38 -0000 1.4 --- comio.cpp 13 Nov 2008 07:41:09 -0000 1.5 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.5 2008/11/13 07:41:09 vfrolov + * Changed for staticaly linking + * * Revision 1.4 2008/10/22 15:31:38 vfrolov * Fixed race condition *************** *** 35,42 **** #include "precomp.h" #include "comio.h" #include "comport.h" #include "import.h" - /////////////////////////////////////////////////////////////// static void TraceError(DWORD err, const char *pFmt, ...) --- 38,48 ---- #include "precomp.h" + #include "../plugins_api.h" + /////////////////////////////////////////////////////////////// + namespace PortTcp { + /////////////////////////////////////////////////////////////// #include "comio.h" #include "comport.h" #include "import.h" /////////////////////////////////////////////////////////////// static void TraceError(DWORD err, const char *pFmt, ...) *************** *** 549,550 **** --- 555,558 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// |
From: Vyacheslav F. <vf...@us...> - 2008-11-13 07:35:16
|
Update of /cvsroot/com0com/hub4com/plugins/serial In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5321 Modified Files: comio.cpp comio.h comparams.cpp comport.cpp comport.h import.h port.cpp Log Message: Changed for staticaly linking Index: comport.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/comport.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** comport.cpp 22 Oct 2008 08:27:26 -0000 1.14 --- comport.cpp 13 Nov 2008 07:35:10 -0000 1.15 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.15 2008/11/13 07:35:10 vfrolov + * Changed for staticaly linking + * * Revision 1.14 2008/10/22 08:27:26 vfrolov * Added ability to set bytesize, parity and stopbits separately *************** *** 92,100 **** #include "precomp.h" #include "comport.h" #include "comio.h" #include "comparams.h" #include "import.h" - /////////////////////////////////////////////////////////////// ComPort::ComPort( --- 95,106 ---- #include "precomp.h" + #include "../plugins_api.h" + /////////////////////////////////////////////////////////////// + namespace PortSerial { + /////////////////////////////////////////////////////////////// #include "comport.h" #include "comio.h" #include "comparams.h" #include "import.h" /////////////////////////////////////////////////////////////// ComPort::ComPort( *************** *** 837,838 **** --- 843,846 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// Index: comparams.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/comparams.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** comparams.cpp 16 Oct 2008 06:57:29 -0000 1.4 --- comparams.cpp 13 Nov 2008 07:35:10 -0000 1.5 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.5 2008/11/13 07:35:10 vfrolov + * Changed for staticaly linking + * * Revision 1.4 2008/10/16 06:57:29 vfrolov * Added ignoring the case of the params *************** *** 48,53 **** #include "precomp.h" #include "comparams.h" - /////////////////////////////////////////////////////////////// ComParams::ComParams() --- 51,58 ---- #include "precomp.h" + /////////////////////////////////////////////////////////////// + namespace PortSerial { + /////////////////////////////////////////////////////////////// #include "comparams.h" /////////////////////////////////////////////////////////////// ComParams::ComParams() *************** *** 251,252 **** --- 256,259 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// Index: port.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/port.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** port.cpp 28 Aug 2008 10:24:35 -0000 1.8 --- port.cpp 13 Nov 2008 07:35:10 -0000 1.9 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.9 2008/11/13 07:35:10 vfrolov + * Changed for staticaly linking + * * Revision 1.8 2008/08/28 10:24:35 vfrolov * Removed linking with ....utils.h and ....utils.cpp *************** *** 47,54 **** #include "precomp.h" #include "comparams.h" #include "comport.h" #include "import.h" - /////////////////////////////////////////////////////////////// static const char *GetParam(const char *pArg, const char *pPattern) --- 50,60 ---- #include "precomp.h" + #include "../plugins_api.h" + /////////////////////////////////////////////////////////////// + namespace PortSerial { + /////////////////////////////////////////////////////////////// #include "comparams.h" #include "comport.h" #include "import.h" /////////////////////////////////////////////////////////////// static const char *GetParam(const char *pArg, const char *pPattern) *************** *** 398,399 **** --- 404,407 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// Index: comio.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/comio.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** comio.h 22 Oct 2008 08:27:26 -0000 1.8 --- comio.h 13 Nov 2008 07:35:10 -0000 1.9 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.9 2008/11/13 07:35:10 vfrolov + * Changed for staticaly linking + * * Revision 1.8 2008/10/22 08:27:26 vfrolov * Added ability to set bytesize, parity and stopbits separately *************** *** 72,77 **** #define _COMIO_H - #include "../plugins_api.h" - /////////////////////////////////////////////////////////////// class ComPort; --- 75,78 ---- Index: comport.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/comport.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** comport.h 30 Sep 2008 08:28:32 -0000 1.9 --- comport.h 13 Nov 2008 07:35:10 -0000 1.10 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.10 2008/11/13 07:35:10 vfrolov + * Changed for staticaly linking + * * Revision 1.9 2008/09/30 08:28:32 vfrolov * Added ability to control OUT1 and OUT2 pins *************** *** 76,81 **** #define _COMPORT_H - #include "../plugins_api.h" - /////////////////////////////////////////////////////////////// class ComParams; --- 79,82 ---- Index: import.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/import.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** import.h 15 Aug 2008 12:44:59 -0000 1.2 --- import.h 13 Nov 2008 07:35:10 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2008/11/13 07:35:10 vfrolov + * Changed for staticaly linking + * * Revision 1.2 2008/08/15 12:44:59 vfrolov * Added fake read filter method to ports *************** *** 31,36 **** #define _IMPORT_H - #include "../plugins_api.h" - /////////////////////////////////////////////////////////////// extern ROUTINE_BUF_ALLOC *pBufAlloc; --- 34,37 ---- Index: comio.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/comio.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** comio.cpp 22 Oct 2008 08:27:26 -0000 1.11 --- comio.cpp 13 Nov 2008 07:35:10 -0000 1.12 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.12 2008/11/13 07:35:10 vfrolov + * Changed for staticaly linking + * * Revision 1.11 2008/10/22 08:27:26 vfrolov * Added ability to set bytesize, parity and stopbits separately *************** *** 85,94 **** #include "precomp.h" #include "comio.h" #include "comport.h" #include "comparams.h" #include "import.h" - #include "..\cncext.h" - /////////////////////////////////////////////////////////////// static void TraceError(DWORD err, const char *pFmt, ...) --- 88,100 ---- #include "precomp.h" + #include "../plugins_api.h" + #include "../cncext.h" + /////////////////////////////////////////////////////////////// + namespace PortSerial { + /////////////////////////////////////////////////////////////// #include "comio.h" #include "comport.h" #include "comparams.h" #include "import.h" /////////////////////////////////////////////////////////////// static void TraceError(DWORD err, const char *pFmt, ...) *************** *** 371,375 **** if (mask & SPS_V2P_MCR(-1)) { if (hasExtendedModemControl) { ! if (!::SetModemControl(handle, SPS_P2V_MCR(value), SPS_P2V_MCR(mask))) cerr << port.Name() << " WARNING: can't change MCR state" << endl; } else { --- 377,381 ---- if (mask & SPS_V2P_MCR(-1)) { if (hasExtendedModemControl) { ! if (!SetModemControl(handle, SPS_P2V_MCR(value), SPS_P2V_MCR(mask))) cerr << port.Name() << " WARNING: can't change MCR state" << endl; } else { *************** *** 377,385 **** if (mask & PIN_STATE_RTS) { ! if (!::CommFunction(handle, (value & PIN_STATE_RTS) ? SETRTS : CLRRTS)) cerr << port.Name() << " WARNING: can't change RTS state" << endl; } if (mask & PIN_STATE_DTR) { ! if (!::CommFunction(handle, (value & PIN_STATE_DTR) ? SETDTR : CLRDTR)) cerr << port.Name() << " WARNING: can't change DTR state" << endl; } --- 383,391 ---- if (mask & PIN_STATE_RTS) { ! if (!CommFunction(handle, (value & PIN_STATE_RTS) ? SETRTS : CLRRTS)) cerr << port.Name() << " WARNING: can't change RTS state" << endl; } if (mask & PIN_STATE_DTR) { ! if (!CommFunction(handle, (value & PIN_STATE_DTR) ? SETDTR : CLRDTR)) cerr << port.Name() << " WARNING: can't change DTR state" << endl; } *************** *** 390,394 **** if (mask & PIN_STATE_BREAK) { ! if (!::CommFunction(handle, (value & PIN_STATE_BREAK) ? SETBREAK : CLRBREAK)) cerr << port.Name() << " WARNING: can't change BREAK state" << endl; } --- 396,400 ---- if (mask & PIN_STATE_BREAK) { ! if (!CommFunction(handle, (value & PIN_STATE_BREAK) ? SETBREAK : CLRBREAK)) cerr << port.Name() << " WARNING: can't change BREAK state" << endl; } *************** *** 853,854 **** --- 859,862 ---- } /////////////////////////////////////////////////////////////// + } // end namespace + /////////////////////////////////////////////////////////////// |
From: Vyacheslav F. <vf...@us...> - 2008-11-13 07:32:14
|
Update of /cvsroot/com0com/hub4com/examples In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5021 Modified Files: com2tcp-esc.bat Log Message: Added TC for trace commenting Index: com2tcp-esc.bat =================================================================== RCS file: /cvsroot/com0com/hub4com/examples/com2tcp-esc.bat,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** com2tcp-esc.bat 16 Oct 2008 16:09:35 -0000 1.3 --- com2tcp-esc.bat 13 Nov 2008 07:32:06 -0000 1.4 *************** *** 54,70 **** :END_SET_LC_SERVER_MODE_OPTIONS ! :SET OPTIONS=%OPTIONS% --create-filter=trace,com,COM SET OPTIONS=%OPTIONS% --create-filter=escparse,com,parse ! :SET OPTIONS=%OPTIONS% --create-filter=trace,com,ExM SET OPTIONS=%OPTIONS% --create-filter=pinmap,com,pinmap:"--rts=cts --dtr=dsr --break=break" SET OPTIONS=%OPTIONS% --create-filter=linectl,com,lc ! :SET OPTIONS=%OPTIONS% --create-filter=trace,com,CxT SET OPTIONS=%OPTIONS% --add-filters=0:com ! :SET OPTIONS=%OPTIONS% --create-filter=trace,tcp,TCP SET OPTIONS=%OPTIONS% --create-filter=escparse,tcp,parse:"--request-esc-mode=no" SET OPTIONS=%OPTIONS% --create-filter=escinsert,tcp,insert ! :SET OPTIONS=%OPTIONS% --create-filter=trace,tcp,ExM SET OPTIONS=%OPTIONS% --create-filter=pinmap,tcp,pinmap:"--cts=cts --dsr=dsr --ring=ring --dcd=dcd --break=break" SET OPTIONS=%OPTIONS% --create-filter=linectl,tcp,lc%TCP_LC_OPTIONS% --- 54,72 ---- :END_SET_LC_SERVER_MODE_OPTIONS ! SET TC=: ! ! %TC% SET OPTIONS=%OPTIONS% --create-filter=trace,com,COM SET OPTIONS=%OPTIONS% --create-filter=escparse,com,parse ! %TC% SET OPTIONS=%OPTIONS% --create-filter=trace,com,ExM SET OPTIONS=%OPTIONS% --create-filter=pinmap,com,pinmap:"--rts=cts --dtr=dsr --break=break" SET OPTIONS=%OPTIONS% --create-filter=linectl,com,lc ! %TC% SET OPTIONS=%OPTIONS% --create-filter=trace,com,CxT SET OPTIONS=%OPTIONS% --add-filters=0:com ! %TC% SET OPTIONS=%OPTIONS% --create-filter=trace,tcp,TCP SET OPTIONS=%OPTIONS% --create-filter=escparse,tcp,parse:"--request-esc-mode=no" SET OPTIONS=%OPTIONS% --create-filter=escinsert,tcp,insert ! %TC% SET OPTIONS=%OPTIONS% --create-filter=trace,tcp,ExM SET OPTIONS=%OPTIONS% --create-filter=pinmap,tcp,pinmap:"--cts=cts --dsr=dsr --ring=ring --dcd=dcd --break=break" SET OPTIONS=%OPTIONS% --create-filter=linectl,tcp,lc%TCP_LC_OPTIONS% |
From: Vyacheslav F. <vf...@us...> - 2008-11-12 08:46:48
|
Update of /cvsroot/com0com/hub4com/plugins/trace In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18672 Modified Files: filter.cpp Log Message: Fixed TYPE_LC and SET_LSR tracing Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/trace/filter.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** filter.cpp 16 Oct 2008 16:02:34 -0000 1.6 --- filter.cpp 12 Nov 2008 08:46:39 -0000 1.7 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.7 2008/11/12 08:46:39 vfrolov + * Fixed TYPE_LC and SET_LSR tracing + * * Revision 1.6 2008/10/16 16:02:34 vfrolov * Added LBR_STATUS and LLC_STATUS *************** *** 579,586 **** break; case HUB_MSG_VAL_TYPE_LC: ! tout << (unsigned)LC2VAL_BYTESIZE(val) << '-'; ! PrintCode(tout, codeNameTableParity, LC2VAL_PARITY(val)); tout << '-'; ! PrintCode(tout, codeNameTableStopBits, LC2VAL_STOPBITS(val)); break; default: --- 582,603 ---- break; case HUB_MSG_VAL_TYPE_LC: ! if (val & LC_MASK_BYTESIZE) ! tout << (unsigned)LC2VAL_BYTESIZE(val); ! else ! tout << 'x'; ! tout << '-'; ! ! if (val & LC_MASK_PARITY) ! PrintCode(tout, codeNameTableParity, LC2VAL_PARITY(val)); ! else ! tout << 'x'; ! ! tout << '-'; ! ! if (val & LC_MASK_STOPBITS) ! PrintCode(tout, codeNameTableStopBits, LC2VAL_STOPBITS(val)); ! else ! tout << 'x'; break; default: *************** *** 620,623 **** --- 637,641 ---- break; case HUB_MSG_TYPE_LINE_STATUS: + case HUB_MSG_TYPE_SET_LSR: PrintMaskedFields(tout, fieldNameTableLineStatus, pMsg->u.val); break; |
From: Vyacheslav F. <vf...@us...> - 2008-10-30 07:54:50
|
Update of /cvsroot/com0com/com0com/sys In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6427 Modified Files: bufutils.c bufutils.h com0com.h handflow.c io.c ioctl.c noise.c noise.h Log Message: Improved BREAK emulation Index: bufutils.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/bufutils.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** bufutils.c 27 Oct 2008 15:13:58 -0000 1.16 --- bufutils.c 30 Oct 2008 07:54:37 -0000 1.17 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.17 2008/10/30 07:54:37 vfrolov + * Improved BREAK emulation + * * Revision 1.16 2008/10/27 15:13:58 vfrolov * Fixed buffer overrun bug *************** *** 174,177 **** --- 177,190 ---- SIZE_T writeDone; + /******************************************************************** + * Special cases if pFlowFilter != NULL: + * + * pReadBuf == NULL && readLength == 0 + * - skip writing to pReadBuf + * + * pWriteBuf == NULL - emulate writeLength noise impulses + * + ********************************************************************/ + HALT_UNLESS3(pReadBuf || (pFlowFilter && !readLength), pReadBuf != NULL, pFlowFilter != NULL, readLength); HALT_UNLESS2(pWriteBuf || pFlowFilter, pReadBuf != NULL, pFlowFilter != NULL); *************** *** 179,183 **** readDone = 0; ! if (pBuf->insertData.size && readLength) { SIZE_T length = pBuf->insertData.size; --- 192,196 ---- readDone = 0; ! if (pBuf->insertData.size && (readLength || pReadBuf == NULL)) { SIZE_T length = pBuf->insertData.size; *************** *** 185,195 **** length, sizeof(pBuf->insertData.data)); ! if (length > readLength) ! length = readLength; - RtlCopyMemory(pReadBuf, pBuf->insertData.data, length); - pReadBuf += length; readDone += length; - readLength -= length; CompactRawData(&pBuf->insertData, length); } --- 198,211 ---- length, sizeof(pBuf->insertData.data)); ! if (pReadBuf) { ! if (length > readLength) ! length = readLength; ! ! RtlCopyMemory(pReadBuf, pBuf->insertData.data, length); ! pReadBuf += length; ! readLength -= length; ! } readDone += length; CompactRawData(&pBuf->insertData, length); } *************** *** 207,238 **** PC0C_IO_PORT pIoPortRemote = pIoPort->pIoPortRemote; ! writeDone = 0; ! ! while (writeLength--) { UCHAR curChar; UCHAR lsr = 0; if (pWriteBuf) { - curChar = *pWriteBuf++; - if (pIoPortRemote->sendBreak) { pIoPortRemote->sendBreak = FALSE; BreakError(pIoPort, &lsr); pFlowFilter->events |= SERIAL_EV_BREAK; } else { ! if (pIoPortRemote->brokeCharsProbability > 0) ! BrokeChar(pIoPortRemote, pIoPort, &curChar, &lsr); } } else { ! if (pIoPortRemote->writeHolding & SERIAL_TX_WAITING_ON_BREAK && !pIoPortRemote->sendBreak) { BreakError(pIoPort, &lsr); pFlowFilter->events |= SERIAL_EV_BREAK; ! curChar = 0x00; } else { ! curChar = 0xFF; } } if (lsr) { BOOLEAN noCurChar = FALSE; --- 223,299 ---- PC0C_IO_PORT pIoPortRemote = pIoPort->pIoPortRemote; ! for (writeDone = 0 ; writeDone < writeLength && (readLength || pReadBuf == NULL) ; writeDone++) { UCHAR curChar; UCHAR lsr = 0; if (pWriteBuf) { if (pIoPortRemote->sendBreak) { pIoPortRemote->sendBreak = FALSE; + pIoPort->rcvdBreak = TRUE; BreakError(pIoPort, &lsr); pFlowFilter->events |= SERIAL_EV_BREAK; + + curChar = 0x00; /* -----------____________ */ + /* iiiiiiiiiiis00000000bbb */ + /* dddddddddddt\______/rrr */ + /* llllllllllla 0x00 eee */ + /* eeeeeeeeeeer aaa */ + /* t kkk */ } else { ! if ((pIoPortRemote->writeHolding & SERIAL_TX_WAITING_ON_BREAK) == 0) { ! if (pIoPortRemote->brokeChars) { ! pIoPortRemote->brokeChars--; ! curChar = GarbageChar(pIoPortRemote, pIoPort, &lsr); ! } else { ! curChar = *pWriteBuf++; ! ! if (pIoPortRemote->brokeCharsProbability > 0) ! BrokeChar(pIoPortRemote, pIoPort, &curChar, &lsr); ! } ! } else { ! if (pIoPortRemote->brokeCharsProbability <= 0 || ! GetBrokenChars(pIoPortRemote->brokeCharsProbability, 1) == 0) ! { ! continue; ! } ! ! BreakError(pIoPort, &lsr); ! pFlowFilter->events |= SERIAL_EV_BREAK; ! ! curChar = 0x00; /* __________-____________ */ ! /* bbbbbbbbbbss00000000bbb */ ! /* rrrrrrrrrrtt\______/rrr */ ! /* eeeeeeeeeeoa 0x00 eee */ ! /* aaaaaaaaaapr aaa */ ! /* kkkkkkkkkk t kkk */ ! } } } else { ! if (pIoPort->rcvdBreak) { ! /* emulate one noise impulse for BREAK state */ ! BreakError(pIoPort, &lsr); pFlowFilter->events |= SERIAL_EV_BREAK; ! curChar = 0x00; /* __________-____________ */ ! /* bbbbbbbbbbss00000000bbb */ ! /* rrrrrrrrrrtt\______/rrr */ ! /* eeeeeeeeeeoa 0x00 eee */ ! /* aaaaaaaaaapr aaa */ ! /* kkkkkkkkkk t kkk */ } else { ! /* emulate one noise impulse for IDLE state */ ! ! curChar = 0xFF; /* ----------_------------ */ ! /* iiiiiiiiiis11111111siii */ ! /* ddddddddddt\______/tddd */ ! /* lllllllllla 0xFF olll */ ! /* eeeeeeeeeer peee */ ! /* t */ } } + pFlowFilter->rxCount++; + if (lsr) { BOOLEAN noCurChar = FALSE; *************** *** 257,266 **** } ! if ((pIoPort->insertMask & C0CE_INSERT_ENABLE_LSR_BI) != 0 && ! (pIoPortRemote->writeHolding & SERIAL_TX_WAITING_ON_BREAK) != 0 && ! !pIoPortRemote->sendBreak) ! { lsr |= 0x10; /* break interrupt indicator */ - } buf[0] = pIoPort->escapeChar; --- 318,323 ---- } ! if ((pIoPort->insertMask & C0CE_INSERT_ENABLE_LSR_BI) != 0 && pIoPort->rcvdBreak) lsr |= 0x10; /* break interrupt indicator */ buf[0] = pIoPort->escapeChar; *************** *** 269,273 **** buf[3] = curChar; - writeDone++; noCurChar = TRUE; --- 326,329 ---- *************** *** 286,296 **** if (length) { #if DBG ! SIZE_T done = #endif /* DBG */ ! AddRawData(&pBuf->insertData, buf + len, length); ! HALT_UNLESS2(done == length, done, length); ! ! break; } } --- 342,354 ---- if (length) { + if (pReadBuf == NULL) { + readDone += length; + } else { #if DBG ! SIZE_T done = #endif /* DBG */ ! AddRawData(&pBuf->insertData, buf + len, length); ! HALT_UNLESS2(done == length, done, length); ! } } } *************** *** 300,313 **** UCHAR errorChar = pIoPort->specialChars.BreakChar; ! if (!readLength--) { #if DBG ! SIZE_T done = #endif /* DBG */ ! AddRawData(&pBuf->insertData, &errorChar, sizeof(errorChar)); ! HALT_UNLESS1(done == sizeof(errorChar), done); ! ! readLength++; } else { *pReadBuf++ = errorChar; readDone++; } --- 358,374 ---- UCHAR errorChar = pIoPort->specialChars.BreakChar; ! if (!readLength) { ! if (pReadBuf == NULL) { ! readDone++; ! } else { #if DBG ! SIZE_T done = #endif /* DBG */ ! AddRawData(&pBuf->insertData, &errorChar, sizeof(errorChar)); ! HALT_UNLESS1(done == sizeof(errorChar), done); ! } } else { *pReadBuf++ = errorChar; + readLength--; readDone++; } *************** *** 318,331 **** UCHAR errorChar = pIoPort->specialChars.ErrorChar; ! if (!readLength--) { #if DBG ! SIZE_T done = #endif /* DBG */ ! AddRawData(&pBuf->insertData, &errorChar, sizeof(errorChar)); ! HALT_UNLESS1(done == sizeof(errorChar), done); ! ! readLength++; } else { *pReadBuf++ = errorChar; readDone++; } --- 379,395 ---- UCHAR errorChar = pIoPort->specialChars.ErrorChar; ! if (!readLength) { ! if (pReadBuf == NULL) { ! readDone++; ! } else { #if DBG ! SIZE_T done = #endif /* DBG */ ! AddRawData(&pBuf->insertData, &errorChar, sizeof(errorChar)); ! HALT_UNLESS1(done == sizeof(errorChar), done); ! } } else { *pReadBuf++ = errorChar; + readLength--; readDone++; } *************** *** 351,359 **** } else { ! if (pReadBuf) { ! if (!readLength--) ! break; ! ! *pReadBuf++ = curChar; pFlowFilter->events |= SERIAL_EV_RXCHAR; --- 415,433 ---- } else { ! if (!readLength) { ! if (pReadBuf == NULL) { ! readDone++; ! } else { ! #if DBG ! SIZE_T done = ! #endif /* DBG */ ! AddRawData(&pBuf->insertData, &curChar, sizeof(curChar)); ! HALT_UNLESS1(done == sizeof(curChar), done); ! } ! } else { ! *pReadBuf++ = curChar; ! readLength--; ! readDone++; ! } pFlowFilter->events |= SERIAL_EV_RXCHAR; *************** *** 368,388 **** curChar = SERIAL_LSRMST_ESCAPE; ! if (!readLength--) { #if DBG ! SIZE_T done = #endif /* DBG */ ! AddRawData(&pBuf->insertData, &curChar, sizeof(curChar)); ! HALT_UNLESS1(done == sizeof(curChar), done); ! ! readLength++; } else { *pReadBuf++ = curChar; readDone++; } } - } - readDone++; } - writeDone++; } } --- 442,462 ---- curChar = SERIAL_LSRMST_ESCAPE; ! if (!readLength) { ! if (pReadBuf == NULL) { ! readDone++; ! } else { #if DBG ! SIZE_T done = #endif /* DBG */ ! AddRawData(&pBuf->insertData, &curChar, sizeof(curChar)); ! HALT_UNLESS1(done == sizeof(curChar), done); ! } } else { *pReadBuf++ = curChar; + readLength--; readDone++; } } } } } *************** *** 464,469 **** if (pOverrun) { if (pBuf->busy >= C0C_BUFFER_SIZE(pBuf)) { - writeDone = readDone = writeLength; - CopyCharsWithEscape( pBuf, pFlowFilter, --- 538,541 ---- Index: ioctl.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/ioctl.c,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** ioctl.c 12 Sep 2008 10:07:50 -0000 1.39 --- ioctl.c 30 Oct 2008 07:54:37 -0000 1.40 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.40 2008/10/30 07:54:37 vfrolov + * Improved BREAK emulation + * * Revision 1.39 2008/09/12 10:07:50 vfrolov * Fixed LSR insertion *************** *** 718,727 **** } ! if ((optsAndBits & C0CE_INSERT_ENABLE_LSR_BI) != 0 && ! (pIoPortRemote->writeHolding & SERIAL_TX_WAITING_ON_BREAK) != 0 && ! !pIoPortRemote->sendBreak) ! { lsr |= 0x10; /* break interrupt indicator */ - } *pSysBuf++ = escapeChar; --- 721,726 ---- } ! if ((optsAndBits & C0CE_INSERT_ENABLE_LSR_BI) != 0 && pIoPortLocal->rcvdBreak) lsr |= 0x10; /* break interrupt indicator */ *pSysBuf++ = escapeChar; Index: com0com.h =================================================================== RCS file: /cvsroot/com0com/com0com/sys/com0com.h,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** com0com.h 17 Sep 2008 07:58:32 -0000 1.46 --- com0com.h 30 Oct 2008 07:54:37 -0000 1.47 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.47 2008/10/30 07:54:37 vfrolov + * Improved BREAK emulation + * * Revision 1.46 2008/09/17 07:58:32 vfrolov * Added AddRTTO and AddRITO parameters *************** *** 350,353 **** --- 353,357 ---- ULONG writeHoldingRemote; BOOLEAN sendBreak; + BOOLEAN rcvdBreak; BOOLEAN tryWrite; Index: bufutils.h =================================================================== RCS file: /cvsroot/com0com/com0com/sys/bufutils.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** bufutils.h 26 Jun 2008 13:37:10 -0000 1.7 --- bufutils.h 30 Oct 2008 07:54:37 -0000 1.8 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.8 2008/10/30 07:54:37 vfrolov + * Improved BREAK emulation + * * Revision 1.7 2008/06/26 13:37:10 vfrolov * Implemented noise emulation *************** *** 56,59 **** --- 59,63 ---- UCHAR lastXonXoff; + SIZE_T rxCount; } C0C_FLOW_FILTER, *PC0C_FLOW_FILTER; Index: noise.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/noise.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** noise.c 2 Sep 2008 07:37:34 -0000 1.3 --- noise.c 30 Oct 2008 07:54:37 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.4 2008/10/30 07:54:37 vfrolov + * Improved BREAK emulation + * * Revision 1.3 2008/09/02 07:37:34 vfrolov * Fixed bits in BreakError() *************** *** 77,85 **** VOID BrokeChar(PC0C_IO_PORT pWriteIoPort, PC0C_IO_PORT pReadIoPort, PUCHAR pChar, PUCHAR pLsr) { - if (pWriteIoPort->brokeChars) { - pWriteIoPort->brokeChars--; - *pChar = GarbageChar(pWriteIoPort, pReadIoPort, pLsr); - } - else if (pWriteIoPort->brokeCharsProbability > (RAND()%C0C_PROBABILITY_ONE)) { int r = (int)(RAND()%( --- 80,83 ---- Index: io.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/io.c,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** io.c 1 Sep 2008 16:54:28 -0000 1.40 --- io.c 30 Oct 2008 07:54:37 -0000 1.41 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.41 2008/10/30 07:54:37 vfrolov + * Improved BREAK emulation + * * Revision 1.40 2008/09/01 16:54:28 vfrolov * Replaced SERIAL_LSRMST_LSR_NODATA by SERIAL_LSRMST_LSR_DATA for BREAK *************** *** 225,233 **** VOID OnRxChars( PC0C_IO_PORT pReadIoPort, - SIZE_T size, PC0C_FLOW_FILTER pFlowFilter, PLIST_ENTRY pQueueToComplete) { PIRP pCurrent; SetXonXoffHolding(pReadIoPort, pFlowFilter->lastXonXoff); --- 228,236 ---- VOID OnRxChars( PC0C_IO_PORT pReadIoPort, PC0C_FLOW_FILTER pFlowFilter, PLIST_ENTRY pQueueToComplete) { PIRP pCurrent; + SIZE_T size = pFlowFilter->rxCount; SetXonXoffHolding(pReadIoPort, pFlowFilter->lastXonXoff); *************** *** 315,322 **** &sendDone); ! if (sendDone) { pReadIoPort->pIoPortRemote->brokeIdleChars -= sendDone; - OnRxChars(pReadIoPort, sendDone, &flowFilter, pQueueToComplete); - } if (readDone) { --- 318,323 ---- &sendDone); ! if (sendDone) pReadIoPort->pIoPortRemote->brokeIdleChars -= sendDone; if (readDone) { *************** *** 350,354 **** } - OnRxChars(pReadIoPort, sendDone, &flowFilter, pQueueToComplete); *pSendDone += sendDone; } --- 351,354 ---- *************** *** 362,365 **** --- 362,368 ---- pIrp->IoStatus.Information = information; + if (flowFilter.rxCount) + OnRxChars(pReadIoPort, &flowFilter, pQueueToComplete); + if (destRestLength == 0) return STATUS_SUCCESS; *************** *** 396,403 **** &sendDone); ! if (sendDone) { pReadIoPort->pIoPortRemote->brokeIdleChars -= sendDone; ! OnRxChars(pReadIoPort, sendDone, &flowFilter, pQueueToComplete); ! } if (readDone) { --- 399,407 ---- &sendDone); ! if (sendDone) pReadIoPort->pIoPortRemote->brokeIdleChars -= sendDone; ! ! if (flowFilter.rxCount) ! OnRxChars(pReadIoPort, &flowFilter, pQueueToComplete); if (readDone) { *************** *** 456,461 **** } ! if (sendDone) ! OnRxChars(pReadIoPort, sendDone, &flowFilter, pQueueToComplete); return sendDone; --- 460,465 ---- } ! if (flowFilter.rxCount) ! OnRxChars(pReadIoPort, &flowFilter, pQueueToComplete); return sendDone; *************** *** 509,515 **** } - OnRxChars(pReadIoPort, sendDone, &flowFilter, pQueueToComplete); *pSendDone += sendDone; } } --- 513,521 ---- } *pSendDone += sendDone; } + + if (flowFilter.rxCount) + OnRxChars(pReadIoPort, &flowFilter, pQueueToComplete); } *************** *** 575,579 **** writeDone = sendDone; ! if (writeDone < length) writeDone += WriteToTxBuffer(&pReadIoPort->pIoPortRemote->txBuf, pWriteBuf + writeDone, length - writeDone); --- 581,585 ---- writeDone = sendDone; ! if (writeDone < length && !isBreak) writeDone += WriteToTxBuffer(&pReadIoPort->pIoPortRemote->txBuf, pWriteBuf + writeDone, length - writeDone); *************** *** 603,612 **** } - OnRxChars(pReadIoPort, sendDone, &flowFilter, pQueueToComplete); - if (!isBreak) *pSendDone += sendDone; } if (information == writeLength) { if (pDataWrite->type == RW_DATA_TYPE_IRP) { --- 609,619 ---- } if (!isBreak) *pSendDone += sendDone; } + if (flowFilter.rxCount) + OnRxChars(pReadIoPort, &flowFilter, pQueueToComplete); + if (information == writeLength) { if (pDataWrite->type == RW_DATA_TYPE_IRP) { *************** *** 694,699 **** } - OnRxChars(pReadIoPort, writeDone, &flowFilter, pQueueToComplete); - if (!isBreak) { pReadIoPort->pIoPortRemote->perfStats.TransmittedCount += (ULONG)writeDone; --- 701,704 ---- *************** *** 702,705 **** --- 707,713 ---- } + if (flowFilter.rxCount) + OnRxChars(pReadIoPort, &flowFilter, pQueueToComplete); + *pReadDone += readDone; } *************** *** 1146,1161 **** ******************************************************************************/ ! /* get special char to send */ ! ! if (pIoPortWrite->sendBreak) { ! /* get BREAK char */ ! ! dataChar.data.chr.type = RW_DATA_TYPE_CHR_BREAK; ! dataChar.data.chr.chr = 0; ! dataChar.data.chr.isChr = TRUE; ! } else { ! /* get XON or XOFF char */ ! switch (pIoPortWrite->sendXonXoff) { case C0C_XCHAR_ON: dataChar.data.chr.type = RW_DATA_TYPE_CHR_XCHR; --- 1154,1160 ---- ******************************************************************************/ ! /* get XON or XOFF char */ ! switch (pIoPortWrite->sendXonXoff) { case C0C_XCHAR_ON: dataChar.data.chr.type = RW_DATA_TYPE_CHR_XCHR; *************** *** 1171,1175 **** dataChar.data.chr.type = RW_DATA_TYPE_CHR_NONE; dataChar.data.chr.isChr = FALSE; - } } --- 1170,1173 ---- *************** *** 1207,1210 **** --- 1205,1227 ---- } else + if (dataChar.data.chr.type != RW_DATA_TYPE_CHR_BREAK && pIoPortWrite->sendBreak) { + /* send BREAK char */ + + dataChar.data.chr.type = RW_DATA_TYPE_CHR_BREAK; + dataChar.data.chr.chr = 0; + dataChar.data.chr.isChr = TRUE; + + if (dataIrpRead.data.irp.status == STATUS_PENDING) { + ReadWriteDirect(dataIrpRead.data.irp.pIrp, + &dataChar, + &dataIrpRead.data.irp.status, + pIoPortRead, + pQueueToComplete, + pWriteLimit, + pWriteDelay, + &doneRead, &doneSend); + } + } + else if (pWriteDelay) { if (pIoPortWrite->brokeCharsProbability > 0) { *************** *** 1253,1256 **** --- 1270,1292 ---- } else + if (dataChar.data.chr.type != RW_DATA_TYPE_CHR_BREAK && pIoPortWrite->sendBreak) { + /* send BREAK char */ + + dataChar.data.chr.type = RW_DATA_TYPE_CHR_BREAK; + dataChar.data.chr.chr = 0; + dataChar.data.chr.isChr = TRUE; + + if (dataIrpRead.data.irp.status == STATUS_PENDING) { + ReadWriteDirect(dataIrpRead.data.irp.pIrp, + &dataChar, + &dataIrpRead.data.irp.status, + pIoPortRead, + pQueueToComplete, + pWriteLimit, + pWriteDelay, + &doneRead, &doneSend); + } + } + else if (pWriteDelay) { if (pIoPortWrite->brokeCharsProbability > 0) { *************** *** 1354,1357 **** --- 1390,1406 ---- } else + if (dataChar.data.chr.type != RW_DATA_TYPE_CHR_BREAK && pIoPortWrite->sendBreak) { + /* send BREAK char */ + + SIZE_T done = 0; + + dataChar.data.chr.type = RW_DATA_TYPE_CHR_BREAK; + dataChar.data.chr.chr = 0; + dataChar.data.chr.isChr = TRUE; + + WriteToBuffers(&dataChar, pIoPortRead, + pQueueToComplete, pWriteLimit, pWriteDelay, &done, &doneSend); + } + else if (pWriteDelay) { if (pIoPortWrite->brokeCharsProbability > 0) { *************** *** 1389,1392 **** --- 1438,1454 ---- } else + if (dataChar.data.chr.type != RW_DATA_TYPE_CHR_BREAK && pIoPortWrite->sendBreak) { + /* send BREAK char */ + + SIZE_T done = 0; + + dataChar.data.chr.type = RW_DATA_TYPE_CHR_BREAK; + dataChar.data.chr.chr = 0; + dataChar.data.chr.isChr = TRUE; + + WriteToBuffers(&dataChar, pIoPortRead, + pQueueToComplete, pWriteLimit, pWriteDelay, &done, &doneSend); + } + else if (pWriteDelay) { if (pIoPortWrite->brokeCharsProbability > 0) { *************** *** 1448,1451 **** --- 1510,1526 ---- } + if (dataChar.data.chr.type != RW_DATA_TYPE_CHR_BREAK && pIoPortWrite->sendBreak) { + /* send BREAK char */ + + SIZE_T done = 0; + + dataChar.data.chr.type = RW_DATA_TYPE_CHR_BREAK; + dataChar.data.chr.chr = 0; + dataChar.data.chr.isChr = TRUE; + + WriteToBuffers(&dataChar, pIoPortRead, + pQueueToComplete, pWriteLimit, pWriteDelay, &done, &doneSend); + } + /******************************************************************************/ Index: handflow.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/handflow.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** handflow.c 25 Aug 2008 14:18:58 -0000 1.11 --- handflow.c 30 Oct 2008 07:54:37 -0000 1.12 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.12 2008/10/30 07:54:37 vfrolov + * Improved BREAK emulation + * * Revision 1.11 2008/08/25 14:18:58 vfrolov * Fixed SERIAL_TRANSMIT_TOGGLE *************** *** 414,417 **** --- 417,422 ---- pIoPortRead = pIoPort->pIoPortRemote; + pIoPortRead->rcvdBreak = FALSE; + if (pIoPortRead->escapeChar && (pIoPortRead->insertMask & C0CE_INSERT_ENABLE_LSR_BI)) { UCHAR lsr = 0; Index: noise.h =================================================================== RCS file: /cvsroot/com0com/com0com/sys/noise.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** noise.h 26 Jun 2008 13:37:10 -0000 1.1 --- noise.h 30 Oct 2008 07:54:37 -0000 1.2 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.2 2008/10/30 07:54:37 vfrolov + * Improved BREAK emulation + * * Revision 1.1 2008/06/26 13:37:10 vfrolov * Implemented noise emulation *************** *** 29,32 **** --- 32,36 ---- VOID BreakError(PC0C_IO_PORT pReadIoPort, PUCHAR pLsr); + UCHAR GarbageChar(PC0C_IO_PORT pWriteIoPort, PC0C_IO_PORT pReadIoPort, PUCHAR pLsr); VOID BrokeChar(PC0C_IO_PORT pWriteIoPort, PC0C_IO_PORT pReadIoPort, PUCHAR pChar, PUCHAR pLsr); SIZE_T GetBrokenChars(ULONG brokeCharsProbability, SIZE_T chars); |
From: Vyacheslav F. <vf...@us...> - 2008-10-27 15:14:03
|
Update of /cvsroot/com0com/com0com/sys In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11438 Modified Files: bufutils.c Log Message: Fixed buffer overrun bug Index: bufutils.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/bufutils.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** bufutils.c 12 Sep 2008 10:07:50 -0000 1.15 --- bufutils.c 27 Oct 2008 15:13:58 -0000 1.16 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.16 2008/10/27 15:13:58 vfrolov + * Fixed buffer overrun bug + * * Revision 1.15 2008/09/12 10:07:50 vfrolov * Fixed LSR insertion *************** *** 467,471 **** NULL, 0, pWriteBuf, writeLength, ! &writeDone, pOverrun); writeDoneTotal += writeDone; --- 470,474 ---- NULL, 0, pWriteBuf, writeLength, ! pOverrun, &writeDone); writeDoneTotal += writeDone; |
From: Vyacheslav F. <vf...@us...> - 2008-10-24 09:21:56
|
Update of /cvsroot/com0com/hub4com/plugins/telnet In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7421 Modified Files: filter.cpp import.h telnet.cpp telnet.h telnet.vcproj Log Message: Implemented RFC 2217 Index: import.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/telnet/import.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** import.h 9 Oct 2008 11:02:58 -0000 1.1 --- import.h 24 Oct 2008 08:29:01 -0000 1.2 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.2 2008/10/24 08:29:01 vfrolov + * Implemented RFC 2217 + * * Revision 1.1 2008/10/09 11:02:58 vfrolov * Redesigned class TelnetProtocol *************** *** 31,36 **** --- 34,41 ---- /////////////////////////////////////////////////////////////// + extern ROUTINE_MSG_INSERT_VAL *pMsgInsertVal; extern ROUTINE_MSG_REPLACE_BUF *pMsgReplaceBuf; extern ROUTINE_MSG_INSERT_BUF *pMsgInsertBuf; + extern ROUTINE_MSG_REPLACE_NONE *pMsgReplaceNone; /////////////////////////////////////////////////////////////// Index: telnet.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/telnet/telnet.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** telnet.h 9 Oct 2008 11:02:58 -0000 1.2 --- telnet.h 24 Oct 2008 08:29:01 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2008/10/24 08:29:01 vfrolov + * Implemented RFC 2217 + * * Revision 1.2 2008/10/09 11:02:58 vfrolov * Redesigned class TelnetProtocol *************** *** 37,54 **** typedef basic_string<BYTE> BYTE_string; /////////////////////////////////////////////////////////////// class TelnetProtocol { public: TelnetProtocol(const char *pName); ! void SetTerminalType(const char *pTerminalType); HUB_MSG *Decode(HUB_MSG *pMsg); HUB_MSG *Encode(HUB_MSG *pMsg); - HUB_MSG *FlushEncodedStream() { return FlushEncodedStream(NULL); } ! void Clear(); protected: void SendOption(BYTE code, BYTE option); ! void SendSubNegotiation(int option, const BYTE_vector ¶ms); static HUB_MSG *Flush(HUB_MSG *pMsg, BYTE_string &stream); --- 40,76 ---- typedef basic_string<BYTE> BYTE_string; /////////////////////////////////////////////////////////////// + class TelnetOption; + /////////////////////////////////////////////////////////////// class TelnetProtocol { public: TelnetProtocol(const char *pName); ! ~TelnetProtocol(); ! ! void Start(); HUB_MSG *Decode(HUB_MSG *pMsg); + void FlushEncodedStream(HUB_MSG **ppEchoMsg); HUB_MSG *Encode(HUB_MSG *pMsg); ! public: ! enum { ! cdSE = 240, ! cdNOP = 241, ! cdSB = 250, ! cdWILL = 251, ! cdWONT = 252, ! cdDO = 253, ! cdDONT = 254, ! cdIAC = 255, ! }; ! protected: + friend class TelnetOption; + + void SetOption(TelnetOption &telnetOption); + void SendOption(BYTE code, BYTE option); ! void SendSubNegotiation(BYTE option, const BYTE_vector ¶ms); static HUB_MSG *Flush(HUB_MSG *pMsg, BYTE_string &stream); *************** *** 60,79 **** int state; ! int code; ! int option; BYTE_vector params; ! struct OptionState ! { ! enum {osCant, osNo, osYes}; ! int localOptionState : 2; ! int remoteOptionState : 2; ! }; ! ! OptionState options[256]; ! BYTE_vector terminalType; BYTE_string streamEncoded; BYTE_string streamDecoded; }; /////////////////////////////////////////////////////////////// --- 82,145 ---- int state; ! BYTE code; ! BYTE option; BYTE_vector params; ! TelnetOption *options[BYTE(-1)]; BYTE_string streamEncoded; BYTE_string streamDecoded; + + #ifdef _DEBUG + private: + BOOL started; + #endif /* _DEBUG */ + }; + /////////////////////////////////////////////////////////////// + class TelnetOption + { + public: + TelnetOption(TelnetProtocol &_telnet, BYTE _option) + : telnet(_telnet), + option(_option), + stateLocal(osCant), + stateRemote(osCant) + { + telnet.SetOption(*this); + } + + void LocalWill() { _ASSERTE(telnet.started != TRUE); stateLocal = osYes; } + void LocalCan() { _ASSERTE(telnet.started != TRUE); stateLocal = osNo; } + void RemoteDo() { _ASSERTE(telnet.started != TRUE); stateRemote = osYes; } + void RemoteMay() { _ASSERTE(telnet.started != TRUE); stateRemote = osNo; } + + protected: + friend class TelnetProtocol; + + virtual void Start(); + + void SendOption(BYTE code) { + telnet.SendOption(code, option); + } + + void SendSubNegotiation(const BYTE_vector ¶ms) { + telnet.SendSubNegotiation(option, params); + } + + HUB_MSG *FlushDecodedStream(HUB_MSG *pMsg) { + return telnet.FlushDecodedStream(pMsg); + } + + virtual BOOL OnSubNegotiation(const BYTE_vector &/*params*/, HUB_MSG ** /*ppMsg*/) { + return FALSE; + } + + TelnetProtocol &telnet; + BYTE option; + + enum {osCant, osNo, osYes}; + + int stateLocal; + int stateRemote; }; /////////////////////////////////////////////////////////////// Index: telnet.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/telnet/telnet.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** telnet.cpp 16 Oct 2008 09:24:23 -0000 1.3 --- telnet.cpp 24 Oct 2008 08:29:01 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.4 2008/10/24 08:29:01 vfrolov + * Implemented RFC 2217 + * * Revision 1.3 2008/10/16 09:24:23 vfrolov * Changed return type of ROUTINE_MSG_REPLACE_*() to BOOL *************** *** 32,72 **** #include "precomp.h" - #include "telnet.h" #include "import.h" /////////////////////////////////////////////////////////////// - enum { - cdSE = 240, - cdNOP = 241, - cdSB = 250, - cdWILL = 251, - cdWONT = 252, - cdDO = 253, - cdDONT = 254, - cdIAC = 255, - }; - static const char *code2name(unsigned code) { switch (code) { ! case cdSE: return "SE"; break; ! case cdNOP: return "NOP"; break; ! case cdSB: return "SB"; break; ! case cdWILL: return "WILL"; break; ! case cdWONT: return "WONT"; break; ! case cdDO: return "DO"; break; ! case cdDONT: return "DONT"; break; --- 35,64 ---- #include "precomp.h" #include "import.h" + #include "telnet.h" /////////////////////////////////////////////////////////////// static const char *code2name(unsigned code) { switch (code) { ! case TelnetProtocol::cdSE: return "SE"; break; ! case TelnetProtocol::cdNOP: return "NOP"; break; ! case TelnetProtocol::cdSB: return "SB"; break; ! case TelnetProtocol::cdWILL: return "WILL"; break; ! case TelnetProtocol::cdWONT: return "WONT"; break; ! case TelnetProtocol::cdDO: return "DO"; break; ! case TelnetProtocol::cdDONT: return "DONT"; break; *************** *** 76,84 **** /////////////////////////////////////////////////////////////// enum { - opEcho = 1, - opTerminalType = 24, - }; - /////////////////////////////////////////////////////////////// - enum { stData, stCode, --- 68,71 ---- *************** *** 91,125 **** : name(pName ? pName : "NONAME") { ! SetTerminalType(NULL); ! Clear(); } ! void TelnetProtocol::SetTerminalType(const char *pTerminalType) { ! terminalType.clear(); ! ! if (!pTerminalType) ! pTerminalType = "UNKNOWN"; ! while (*pTerminalType) ! terminalType.push_back(*pTerminalType++); } ! void TelnetProtocol::Clear() { ! cout << name << " RESET" << endl; ! ! state = stData; ! for(int i = 0 ; i < sizeof(options)/sizeof(options[0]) ; i++) { ! options[i].remoteOptionState = OptionState::osCant; ! options[i].localOptionState = OptionState::osCant; } ! options[opEcho].remoteOptionState = OptionState::osNo; ! options[opTerminalType].localOptionState = OptionState::osNo; ! streamEncoded.clear(); ! streamDecoded.clear(); } --- 78,118 ---- : name(pName ? pName : "NONAME") { ! cout << name << " START" << endl; ! ! state = stData; ! ! for(int i = 0 ; i < BYTE(-1) ; i++) ! options[i] = NULL; } ! TelnetProtocol::~TelnetProtocol() { ! cout << name << " STOP" << endl; ! for(int i = 0 ; i < BYTE(-1) ; i++) { ! if (options[i]) ! delete options[i]; ! } } ! void TelnetProtocol::Start() { ! _ASSERTE(started != TRUE); ! for(int i = 0 ; i < BYTE(-1) ; i++) { ! if (options[i]) ! options[i]->Start(); } ! #ifdef _DEBUG ! started = TRUE; ! #endif /* _DEBUG */ ! } ! void TelnetProtocol::SetOption(TelnetOption &telnetOption) ! { ! _ASSERTE(started != TRUE); ! _ASSERTE(options[telnetOption.option] == NULL); ! options[telnetOption.option] = &telnetOption; } *************** *** 140,143 **** --- 133,137 ---- HUB_MSG *TelnetProtocol::Encode(HUB_MSG *pMsg) { + _ASSERTE(started == TRUE); _ASSERTE(pMsg->type == HUB_MSG_TYPE_LINE_DATA); *************** *** 164,167 **** --- 158,162 ---- HUB_MSG *TelnetProtocol::Decode(HUB_MSG *pMsg) { + _ASSERTE(started == TRUE); _ASSERTE(pMsg->type == HUB_MSG_TYPE_LINE_DATA); *************** *** 216,264 **** break; case cdWILL: ! switch (options[ch].remoteOptionState) { ! case OptionState::osCant: ! SendOption(cdDONT, ch); ! break; ! case OptionState::osNo: ! options[ch].remoteOptionState = OptionState::osYes; ! SendOption(cdDO, ch); ! break; ! case OptionState::osYes: ! break; } break; case cdWONT: ! switch (options[ch].remoteOptionState) { ! case OptionState::osCant: ! case OptionState::osNo: ! break; ! case OptionState::osYes: ! options[ch].remoteOptionState = OptionState::osNo; ! SendOption(cdDONT, ch); ! break; } break; case cdDO: ! switch (options[ch].localOptionState) { ! case OptionState::osCant: ! SendOption(cdWONT, ch); ! break; ! case OptionState::osNo: ! options[ch].localOptionState = OptionState::osYes; ! SendOption(cdWILL, ch); ! break; ! case OptionState::osYes: ! break; } break; case cdDONT: ! switch (options[ch].localOptionState) { ! case OptionState::osCant: ! case OptionState::osNo: ! break; ! case OptionState::osYes: ! options[ch].localOptionState = OptionState::osNo; ! SendOption(cdWONT, ch); ! break; } break; --- 211,243 ---- break; case cdWILL: ! if (options[ch] == NULL || options[ch]->stateRemote == TelnetOption::osCant) { ! SendOption(cdDONT, ch); ! } ! else ! if (options[ch]->stateRemote == TelnetOption::osNo) { ! options[ch]->stateRemote = TelnetOption::osYes; ! SendOption(cdDO, ch); } break; case cdWONT: ! if (options[ch] != NULL && options[ch]->stateRemote == TelnetOption::osYes) { ! options[ch]->stateRemote = TelnetOption::osNo; ! SendOption(cdDONT, ch); } break; case cdDO: ! if (options[ch] == NULL || options[ch]->stateLocal == TelnetOption::osCant) { ! SendOption(cdWONT, ch); ! } ! else ! if (options[ch]->stateLocal == TelnetOption::osNo) { ! options[ch]->stateLocal = TelnetOption::osYes; ! SendOption(cdWILL, ch); } break; case cdDONT: ! if (options[ch] != NULL && options[ch]->stateLocal == TelnetOption::osYes) { ! options[ch]->stateLocal = TelnetOption::osNo; ! SendOption(cdWONT, ch); } break; *************** *** 289,302 **** cout << "SE" << endl; ! switch (option) { ! case opTerminalType: ! params.clear(); ! params.push_back(0); ! params.insert(params.end(), terminalType.begin(), terminalType.end()); ! SendSubNegotiation(option, params); ! break; ! default: ! cout << " ignored" << endl; ! } state = stData; --- 268,276 ---- cout << "SE" << endl; ! if (!options[option] || !options[option]->OnSubNegotiation(params, &pMsg)) ! cout << " ignored" << endl; ! ! if (!pMsg) ! return NULL; state = stData; *************** *** 313,316 **** --- 287,300 ---- } + void TelnetProtocol::FlushEncodedStream(HUB_MSG **ppEchoMsg) + { + _ASSERTE(started == TRUE); + + if (*ppEchoMsg) + FlushEncodedStream(*ppEchoMsg); + else + *ppEchoMsg = FlushEncodedStream((HUB_MSG *)NULL); + } + void TelnetProtocol::SendOption(BYTE code, BYTE option) { *************** *** 322,328 **** } ! void TelnetProtocol::SendSubNegotiation(int option, const BYTE_vector ¶ms) { ! SendOption(cdSB, (BYTE)option); cout << " "; --- 306,312 ---- } ! void TelnetProtocol::SendSubNegotiation(BYTE option, const BYTE_vector ¶ms) { ! SendOption(cdSB, option); cout << " "; *************** *** 332,335 **** --- 316,322 ---- cout << (unsigned)b << " "; streamEncoded += b; + + if (b == cdIAC) + streamEncoded += b; } cout << "SE" << endl; *************** *** 339,340 **** --- 326,336 ---- } /////////////////////////////////////////////////////////////// + void TelnetOption::Start() + { + if (stateLocal == osYes) + SendOption(TelnetProtocol::cdWILL); + + if (stateRemote == osYes) + SendOption(TelnetProtocol::cdDO); + } + /////////////////////////////////////////////////////////////// Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/telnet/filter.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** filter.cpp 9 Oct 2008 11:02:58 -0000 1.4 --- filter.cpp 24 Oct 2008 08:29:01 -0000 1.5 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.5 2008/10/24 08:29:01 vfrolov + * Implemented RFC 2217 + * * Revision 1.4 2008/10/09 11:02:58 vfrolov * Redesigned class TelnetProtocol *************** *** 35,43 **** #include "precomp.h" - #include "telnet.h" #include "import.h" /////////////////////////////////////////////////////////////// static ROUTINE_PORT_NAME_A *pPortName; /////////////////////////////////////////////////////////////// const char *GetParam(const char *pArg, const char *pPattern) --- 38,49 ---- #include "precomp.h" #include "import.h" + #include "opt_termtype.h" + #include "opt_comport.h" /////////////////////////////////////////////////////////////// + static ROUTINE_MSG_INSERT_NONE *pMsgInsertNone; static ROUTINE_PORT_NAME_A *pPortName; + static ROUTINE_FILTER_NAME_A *pFilterName; /////////////////////////////////////////////////////////////// const char *GetParam(const char *pArg, const char *pPattern) *************** *** 60,76 **** }; /////////////////////////////////////////////////////////////// class Filter : public Valid { public: Filter(int argc, const char *const argv[]); void SetHub(HHUB _hHub) { hHub = _hHub; } ! TelnetProtocol *GetProtocol(int nPort); ! void DelProtocol(int nPort); private: HHUB hHub; string terminalType; ! typedef map<int, TelnetProtocol*> PortsMap; ! typedef pair<int, TelnetProtocol*> PortPair; PortsMap portsMap; --- 66,136 ---- }; /////////////////////////////////////////////////////////////// + class State { + public: + State() + : pTelnetProtocol(NULL), + pComPort(NULL), + soMask(0), + goMask(0), + pinState(0), + br(0), + lc(0) + {} + + void SetProtocol(TelnetProtocol *_pTelnetProtocol) { + pComPort = NULL; + if (pTelnetProtocol) + delete pTelnetProtocol; + pTelnetProtocol = _pTelnetProtocol; + } + + void SetOption(TelnetOptionComPort *_pComPort) { + pComPort = _pComPort; + } + + TelnetProtocol *pTelnetProtocol; + TelnetOptionComPort *pComPort; + DWORD soMask; + DWORD goMask; + WORD pinState; + DWORD br; + DWORD lc; + }; + /////////////////////////////////////////////////////////////// class Filter : public Valid { 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) ! return NULL; ! ! return pState->pTelnetProtocol; ! } ! ! DWORD soMask; ! DWORD goMask; private: HHUB hHub; string terminalType; + BOOL suppressEcho; ! enum { ! comport_no, ! comport_client, ! comport_server ! } comport; ! ! typedef map<int, State*> PortsMap; ! typedef pair<int, State*> PortPair; PortsMap portsMap; *************** *** 79,83 **** Filter::Filter(int argc, const char *const argv[]) : hHub(NULL), ! terminalType("UNKNOWN") { for (const char *const *pArgs = &argv[1] ; argc > 1 ; pArgs++, argc--) { --- 139,145 ---- Filter::Filter(int argc, const char *const argv[]) : hHub(NULL), ! terminalType("UNKNOWN"), ! suppressEcho(FALSE), ! comport(comport_no) { for (const char *const *pArgs = &argv[1] ; argc > 1 ; pArgs++, argc--) { *************** *** 94,105 **** if ((pParam = GetParam(pArg, "terminal=")) != NULL) { terminalType = pParam; ! } else { cerr << "Unknown option " << pArg << endl; Invalidate(); } } } ! TelnetProtocol *Filter::GetProtocol(int nPort) { PortsMap::iterator iPair = portsMap.find(nPort); --- 156,221 ---- if ((pParam = GetParam(pArg, "terminal=")) != NULL) { terminalType = pParam; ! } ! else ! if ((pParam = GetParam(pArg, "comport=")) != NULL) { ! switch (tolower(*pParam)) { ! case 'n': ! comport = comport_no; ! break; ! case 'c': ! comport = comport_client; ! break; ! case 's': ! comport = comport_server; ! break; ! default: ! cerr << "Unknown value in " << pArg << endl; ! Invalidate(); ! } ! } ! else ! if ((pParam = GetParam(pArg, "suppress-echo=")) != NULL) { ! switch (tolower(*pParam)) { ! case 'y': ! suppressEcho = TRUE; ! break; ! case 'n': ! suppressEcho = FALSE; ! break; ! default: ! cerr << "Unknown value in " << pArg << endl; ! Invalidate(); ! } ! } ! else { cerr << "Unknown option " << pArg << endl; Invalidate(); } } + + switch (comport) { + case comport_client: + soMask = SO_V2O_PIN_STATE(PIN_STATE_DTR|PIN_STATE_RTS|PIN_STATE_BREAK) | + SO_SET_BR|SO_SET_LC; + + goMask = GO_V2O_LINE_STATUS(-1) | + GO_V2O_MODEM_STATUS(-1) | + GO_LBR_STATUS|GO_LLC_STATUS; + break; + case comport_server: + soMask = SO_V2O_PIN_STATE(SPS_V2P_MST(-1)) | + SO_V2O_LINE_STATUS(-1) | + SO_SET_BR|SO_SET_LC; + + goMask = GO_V2O_MODEM_STATUS(MODEM_STATUS_CTS|MODEM_STATUS_DSR) | + GO_RBR_STATUS|GO_RLC_STATUS|GO_BREAK_STATUS; + break; + default: + soMask = 0; + goMask = 0; + } } ! State *Filter::GetState(int nPort) { PortsMap::iterator iPair = portsMap.find(nPort); *************** *** 114,137 **** } ! if (!iPair->second) { ! iPair->second = new TelnetProtocol(pPortName(hHub, nPort)); ! ! if (iPair->second) ! iPair->second->SetTerminalType(terminalType.c_str()); ! } return iPair->second; } ! void Filter::DelProtocol(int nPort) { ! PortsMap::iterator iPair = portsMap.find(nPort); ! if (iPair != portsMap.end()) { ! if (iPair->second) ! delete iPair->second; ! iPair->second = NULL; } } /////////////////////////////////////////////////////////////// --- 230,308 ---- } ! if (!iPair->second) ! iPair->second = new State(); return iPair->second; } ! TelnetProtocol *Filter::CreateProtocol(State *pState, const char *pName) { ! _ASSERTE(pState->pTelnetProtocol == NULL); ! TelnetProtocol *pTelnetProtocol = new TelnetProtocol(pName); ! if (!pTelnetProtocol) ! return NULL; ! ! pState->SetProtocol(pTelnetProtocol); ! ! TelnetOption *pTo; ! ! if (!terminalType.empty()) { ! pTo = new TelnetOptionTerminalType(*pTelnetProtocol, terminalType.c_str()); ! ! if (pTo) ! pTo->LocalCan(); ! } ! ! pTo = new TelnetOption(*pTelnetProtocol, 0 /*TRANSMIT-BINARY*/); ! ! if (pTo) { ! pTo->RemoteMay(); ! pTo->LocalCan(); ! } ! ! pTo = new TelnetOption(*pTelnetProtocol, 1 /*ECHO*/); ! ! if (pTo) { ! pTo->RemoteMay(); ! ! if (suppressEcho) ! pTo->LocalWill(); ! } ! ! pTo = new TelnetOption(*pTelnetProtocol, 3 /*SUPPRESS-GO-AHEAD*/); ! ! if (pTo) { ! pTo->RemoteMay(); ! pTo->LocalCan(); ! } ! ! if (comport == comport_client) { ! pTo = new TelnetOptionComPortClient(*pTelnetProtocol, pState->goMask, pState->soMask); ! ! if (pTo) { ! pTo->LocalWill(); ! pState->SetOption((TelnetOptionComPortClient *)pTo); ! } ! } ! else ! if (comport == comport_server) { ! pTo = new TelnetOptionComPortServer(*pTelnetProtocol, pState->goMask, pState->soMask); ! ! if (pTo) { ! pTo->RemoteDo(); ! pState->SetOption((TelnetOptionComPortServer *)pTo); ! } } + + return pTelnetProtocol; + } + + void Filter::DelProtocol(State *pState) + { + _ASSERTE(pState->pTelnetProtocol != NULL); + + pState->SetProtocol(NULL); } /////////////////////////////////////////////////////////////// *************** *** 161,182 **** << endl << "Options:" << endl ! << " --terminal=<t> - use terminal type <t> (RFC 1091)." << endl << endl << "IN method input data stream description:" << endl ! << " LINE_DATA(<data>) - <data> is the telnet protocol wrapped raw bytes." << endl ! << " CONNECT(TRUE) - start telnet protocol engine if it's not started." << endl ! << " CONNECT(FALSE) - stop telnet protocol engine if it's started." << endl << endl << "IN method output data stream description:" << endl ! << " LINE_DATA(<data>) - <data> is the raw bytes." << endl << endl << "IN method echo data stream description:" << endl ! << " LINE_DATA(<data>) - <data> is the telnet protocol wrapped raw bytes." << endl << endl << "OUT method input data stream description:" << endl ! << " LINE_DATA(<data>) - <data> is the raw bytes." << endl << endl << "OUT method output data stream description:" << endl ! << " LINE_DATA(<data>) - <data> is the telnet protocol wrapped raw bytes." << endl << endl << "Examples:" << endl --- 332,386 ---- << endl << "Options:" << endl ! << " --terminal=<type> - use terminal type <type> (RFC 1091)." << endl ! << " --comport=<mode> - enable/disable Com Port Control Option (RFC 2217)." << endl ! << " Where <mode> is c[lient], s[erver] or n[o] (no by" << endl ! << " default)." << endl ! << " --suppress-echo=<c> - enable/disable local echo suppression on the" << endl ! << " remote side. Where <c> is y[es] or n[o] (no by" << endl ! << " default)." << endl << endl << "IN method input data stream description:" << endl ! << " LINE_DATA - telnet protocol data." << endl ! << " CONNECT(TRUE) - start telnet protocol engine." << endl ! << " CONNECT(FALSE) - stop telnet protocol engine." << endl << endl << "IN method output data stream description:" << endl ! << " LINE_DATA - raw data." << endl ! << " " << endl ! << " Notifications about events on the server side (RFC 2217 client mode):" << endl ! << " " << endl ! << " LBR_STATUS - baud rate was set." << endl ! << " LLC_STATUS - data bits, parity or stop bits was set." << endl ! << " LINE_STATUS - line state was changed." << endl ! << " MODEM_STATUS - modem line state was changed." << endl ! << " " << endl ! << " Notifications about commands from client side (RFC 2217 server mode):" << endl ! << " " << endl ! << " RBR_STATUS - set baud rate." << endl ! << " RLC_STATUS - set data bits, parity or stop bits." << endl ! << " BREAK_STATUS - set BREAK state." << endl ! << " MODEM_STATUS(DSR/CTS) - set modem lines (DTR/RTS)." << endl << endl << "IN method echo data stream description:" << endl ! << " LINE_DATA - telnet protocol data." << endl << endl << "OUT method input data stream description:" << endl ! << " LINE_DATA - raw data." << endl ! << " " << endl ! << " RFC 2217 client mode:" << endl ! << " " << endl ! << " SET_BR - set baud rate." << endl ! << " SET_LC - set data bits, parity or stop bits." << endl ! << " SET_PIN_STATE - set modem lines (DTR/RTS)." << endl ! << " " << endl ! << " RFC 2217 server mode:" << endl ! << " " << endl ! << " SET_BR - baud rate was set." << endl ! << " SET_LC - data bits, parity or stop bits was set." << endl ! << " SET_LSR - line state was changed." << endl ! << " SET_PIN_STATE - modem line state was changed." << endl << endl << "OUT method output data stream description:" << endl ! << " LINE_DATA - telnet protocol data." << endl << endl << "Examples:" << endl *************** *** 234,261 **** _ASSERTE(*ppEchoMsg == NULL); ! if (pInMsg->type == HUB_MSG_TYPE_LINE_DATA) { ! _ASSERTE(pInMsg->u.buf.pBuf != NULL || pInMsg->u.buf.size == 0); ! if (pInMsg->u.buf.size == 0) ! return TRUE; ! TelnetProtocol *pTelnetProtocol = ((Filter *)hFilter)->GetProtocol(nFromPort); ! if (!pTelnetProtocol) ! return FALSE; ! pInMsg = pTelnetProtocol->Decode(pInMsg); ! *ppEchoMsg = pTelnetProtocol->FlushEncodedStream(); ! if (!pInMsg) ! return FALSE; ! } ! else ! if (pInMsg->type == HUB_MSG_TYPE_CONNECT) { ! if (pInMsg->u.val) ! ((Filter *)hFilter)->GetProtocol(nFromPort); ! else ! ((Filter *)hFilter)->DelProtocol(nFromPort); } return TRUE; } --- 438,549 ---- _ASSERTE(*ppEchoMsg == NULL); ! switch (pInMsg->type) { ! case HUB_MSG_TYPE_GET_IN_OPTS: { ! if (!((Filter *)hFilter)->goMask) ! break; ! State *pState = ((Filter *)hFilter)->GetState(nFromPort); ! if (!pState) ! return FALSE; ! // get interceptable options from subsequent filters separately ! DWORD interceptable_options = (pInMsg->u.pv.val & ((Filter *)hFilter)->goMask); ! pInMsg->u.pv.val &= ~interceptable_options; ! ! pInMsg = pMsgInsertNone(pInMsg, HUB_MSG_TYPE_EMPTY); ! ! if (!pInMsg) ! return FALSE; ! ! pInMsg->type = HUB_MSG_TYPE_GET_IN_OPTS; ! pInMsg->u.pv.pVal = &pState->goMask; ! pInMsg->u.pv.val = interceptable_options; ! ! break; ! } ! case HUB_MSG_TYPE_LINE_DATA: { ! _ASSERTE(pInMsg->u.buf.pBuf != NULL || pInMsg->u.buf.size == 0); ! ! if (pInMsg->u.buf.size == 0) ! break; ! ! TelnetProtocol *pTelnetProtocol = ((Filter *)hFilter)->GetProtocol(nFromPort); ! ! if (!pTelnetProtocol) ! break; ! ! if (!pTelnetProtocol->Decode(pInMsg)) ! return FALSE; ! ! pTelnetProtocol->FlushEncodedStream(ppEchoMsg); ! ! break; ! } ! case HUB_MSG_TYPE_CONNECT: { ! State *pState = ((Filter *)hFilter)->GetState(nFromPort); ! ! if (!pState) ! return FALSE; ! ! if (!pInMsg->u.val) { ! if (pState->pComPort) { ! if (pState->goMask & GO_BREAK_STATUS) { ! pInMsg = pMsgInsertVal(pInMsg, HUB_MSG_TYPE_BREAK_STATUS, FALSE); ! ! if (!pInMsg) ! return FALSE; ! } ! ! if (pState->goMask & GO_V2O_MODEM_STATUS(-1)) { ! pInMsg = pMsgInsertVal(pInMsg, HUB_MSG_TYPE_MODEM_STATUS, ! 0 | VAL2MASK(GO_O2V_MODEM_STATUS(pState->goMask))); ! ! if (!pInMsg) ! return FALSE; ! } ! } ! ! ((Filter *)hFilter)->DelProtocol(pState); ! break; ! } ! ! TelnetProtocol *pTelnetProtocol = ((Filter *)hFilter)->CreateProtocol(pState, ((Filter *)hFilter)->PortName(nFromPort)); ! ! if (!pTelnetProtocol) ! return FALSE; ! ! pTelnetProtocol->Start(); ! ! if (pState->pComPort) { ! // Set current state ! ! if ((pState->soMask & SO_SET_BR) && pState->br != 0) ! pState->pComPort->SetBR(pState->br); ! ! if (pState->soMask & SO_SET_LC) ! pState->pComPort->SetLC(pState->lc); ! ! if (pState->soMask & SO_V2O_PIN_STATE(SPS_V2P_MST(-1))) ! pState->pComPort->NotifyMST(SPS_P2V_MST(pState->pinState)); ! ! if (pState->soMask & SO_V2O_PIN_STATE(SPS_V2P_MCR(-1))) ! pState->pComPort->SetMCR(SPS_P2V_MCR(pState->pinState), SPS_P2V_MCR(SO_O2V_PIN_STATE(pState->soMask))); ! ! if (pState->soMask & SO_V2O_PIN_STATE(PIN_STATE_BREAK)) ! pState->pComPort->SetBreak((pState->pinState & PIN_STATE_BREAK) != 0); ! ! if (pState->soMask & SO_V2O_LINE_STATUS(-1)) ! pState->pComPort->NotifyLSR(0); ! } ! ! pTelnetProtocol->FlushEncodedStream(ppEchoMsg); ! ! break; ! } } + return TRUE; } *************** *** 270,290 **** _ASSERTE(pOutMsg != NULL); ! if (pOutMsg->type == HUB_MSG_TYPE_LINE_DATA) { ! _ASSERTE(pOutMsg->u.buf.pBuf != NULL || pOutMsg->u.buf.size == 0); ! if (pOutMsg->u.buf.size == 0) ! return TRUE; ! TelnetProtocol *pTelnetProtocol = ((Filter *)hFilter)->GetProtocol(nToPort); ! if (!pTelnetProtocol) ! return FALSE; ! pOutMsg = pTelnetProtocol->Encode(pOutMsg); ! if (!pOutMsg) ! return FALSE; } ! return TRUE; } /////////////////////////////////////////////////////////////// --- 558,738 ---- _ASSERTE(pOutMsg != NULL); ! switch (pOutMsg->type) { ! case HUB_MSG_TYPE_SET_OUT_OPTS: { ! DWORD soMask = (pOutMsg->u.val & ((Filter *)hFilter)->soMask); ! // discard supported options ! pOutMsg->u.val &= ~((Filter *)hFilter)->soMask; ! State *pState = ((Filter *)hFilter)->GetState(nToPort); ! if (!pState) ! return FALSE; ! pState->soMask |= soMask; ! break; ! } ! case HUB_MSG_TYPE_SET_BR: { ! State *pState = ((Filter *)hFilter)->GetState(nToPort); ! ! if (!pState) ! return FALSE; ! ! _ASSERTE(((pState->soMask | ~((Filter *)hFilter)->soMask) & SO_SET_BR) != 0); ! ! if (pState->soMask & SO_SET_BR) { ! DWORD val = pOutMsg->u.val; ! ! // discard messages for supported options ! if (!pMsgReplaceNone(pOutMsg, HUB_MSG_TYPE_EMPTY)) ! return FALSE; ! ! if (pState->br != val) { ! pState->br = val; ! ! if (pState->pComPort) { ! pState->pComPort->SetBR(pState->br); ! _ASSERTE(pState->pTelnetProtocol != NULL); ! pState->pTelnetProtocol->FlushEncodedStream(&pOutMsg); ! } ! } ! } ! ! break; ! } ! case HUB_MSG_TYPE_SET_LC: { ! _ASSERTE((pOutMsg->u.val & ~(VAL2LC_BYTESIZE(-1)|LC_MASK_BYTESIZE ! |VAL2LC_PARITY(-1)|LC_MASK_PARITY ! |VAL2LC_STOPBITS(-1)|LC_MASK_STOPBITS)) == 0); ! ! State *pState = ((Filter *)hFilter)->GetState(nToPort); ! ! if (!pState) ! return FALSE; ! ! _ASSERTE(((pState->soMask | ~((Filter *)hFilter)->soMask) & SO_SET_LC) != 0); ! ! if (pState->soMask & SO_SET_LC) { ! DWORD val = pOutMsg->u.val; ! ! // discard messages for supported options ! if (!pMsgReplaceNone(pOutMsg, HUB_MSG_TYPE_EMPTY)) ! return FALSE; ! ! if ((val & LC_MASK_BYTESIZE) == 0) { ! _ASSERTE((val & VAL2LC_BYTESIZE(-1)) == 0); ! val |= (pState->lc & (VAL2LC_BYTESIZE(-1)|LC_MASK_BYTESIZE)); ! } ! ! if ((val & LC_MASK_PARITY) == 0) { ! _ASSERTE((val & VAL2LC_PARITY(-1)) == 0); ! val |= (pState->lc & (VAL2LC_PARITY(-1)|LC_MASK_PARITY)); ! } ! ! if ((val & LC_MASK_STOPBITS) == 0) { ! _ASSERTE((val & VAL2LC_STOPBITS(-1)) == 0); ! val |= (pState->lc & (VAL2LC_STOPBITS(-1)|LC_MASK_STOPBITS)); ! } ! ! if (pState->lc != val) { ! pState->lc = val; ! ! if (pState->pComPort) { ! pState->pComPort->SetLC(pState->lc); ! _ASSERTE(pState->pTelnetProtocol != NULL); ! pState->pTelnetProtocol->FlushEncodedStream(&pOutMsg); ! } ! } ! } ! ! break; ! } ! case HUB_MSG_TYPE_SET_PIN_STATE: { ! State *pState = ((Filter *)hFilter)->GetState(nToPort); ! ! if (!pState) ! return FALSE; ! ! _ASSERTE(((pState->soMask | ~((Filter *)hFilter)->soMask) & SO_V2O_PIN_STATE(-1)) != 0); ! ! WORD mask = MASK2VAL(pOutMsg->u.val) & SO_O2V_PIN_STATE(pState->soMask); ! ! if (!mask) ! break; ! ! WORD pinState = (WORD)pOutMsg->u.val; ! ! // discard settings for supported options ! pOutMsg->u.val &= ~VAL2MASK(mask); ! ! pinState = ((pinState & mask) | (pState->pinState & ~mask)); ! mask = pState->pinState ^ pinState; ! ! if (mask) { ! if (pState->pComPort) { ! if (SPS_P2V_MST(mask)) ! pState->pComPort->NotifyMST(SPS_P2V_MST(pinState)); ! ! if (SPS_P2V_MCR(mask)) ! pState->pComPort->SetMCR(SPS_P2V_MCR(pinState), SPS_P2V_MCR(mask)); ! ! if (mask & PIN_STATE_BREAK) ! pState->pComPort->SetBreak((pinState & PIN_STATE_BREAK) != 0); ! ! _ASSERTE(pState->pTelnetProtocol != NULL); ! pState->pTelnetProtocol->FlushEncodedStream(&pOutMsg); ! } ! ! pState->pinState = pinState; ! } ! ! break; ! } ! case HUB_MSG_TYPE_SET_LSR: { ! State *pState = ((Filter *)hFilter)->GetState(nToPort); ! ! if (!pState) ! return FALSE; ! ! _ASSERTE(((pState->soMask | ~((Filter *)hFilter)->soMask) & SO_V2O_LINE_STATUS(-1)) != 0); ! ! BYTE lsr; ! ! lsr = (BYTE)pOutMsg->u.val & (BYTE)MASK2VAL(pOutMsg->u.val) & SO_O2V_LINE_STATUS(pState->soMask); ! ! // discard settings for supported options ! pOutMsg->u.val &= ~VAL2MASK(SO_O2V_LINE_STATUS(pState->soMask)); ! ! if (!lsr) ! break; ! ! if (pState->pComPort) { ! pState->pComPort->NotifyLSR(lsr); ! _ASSERTE(pState->pTelnetProtocol != NULL); ! pState->pTelnetProtocol->FlushEncodedStream(&pOutMsg); ! } ! ! break; ! } ! case HUB_MSG_TYPE_LINE_DATA: { ! _ASSERTE(pOutMsg->u.buf.pBuf != NULL || pOutMsg->u.buf.size == 0); ! ! if (pOutMsg->u.buf.size == 0) ! break; ! ! TelnetProtocol *pTelnetProtocol = ((Filter *)hFilter)->GetProtocol(nToPort); ! ! if (!pTelnetProtocol) ! break; ! ! if (!pTelnetProtocol->Encode(pOutMsg)) ! return FALSE; ! ! break; ! } } ! ! return pOutMsg != NULL; } /////////////////////////////////////////////////////////////// *************** *** 308,313 **** --- 756,763 ---- }; /////////////////////////////////////////////////////////////// + ROUTINE_MSG_INSERT_VAL *pMsgInsertVal; ROUTINE_MSG_REPLACE_BUF *pMsgReplaceBuf; ROUTINE_MSG_INSERT_BUF *pMsgInsertBuf; + ROUTINE_MSG_REPLACE_NONE *pMsgReplaceNone; /////////////////////////////////////////////////////////////// PLUGIN_INIT_A InitA; *************** *** 315,328 **** const HUB_ROUTINES_A * pHubRoutines) { ! if (!ROUTINE_IS_VALID(pHubRoutines, pMsgReplaceBuf) || !ROUTINE_IS_VALID(pHubRoutines, pMsgInsertBuf) || ! !ROUTINE_IS_VALID(pHubRoutines, pPortName)) { return NULL; } pMsgReplaceBuf = pHubRoutines->pMsgReplaceBuf; pMsgInsertBuf = pHubRoutines->pMsgInsertBuf; pPortName = pHubRoutines->pPortName; return plugins; --- 765,786 ---- const HUB_ROUTINES_A * pHubRoutines) { ! if (!ROUTINE_IS_VALID(pHubRoutines, pMsgInsertVal) || ! !ROUTINE_IS_VALID(pHubRoutines, pMsgReplaceBuf) || !ROUTINE_IS_VALID(pHubRoutines, pMsgInsertBuf) || ! !ROUTINE_IS_VALID(pHubRoutines, pMsgReplaceNone) || ! !ROUTINE_IS_VALID(pHubRoutines, pMsgInsertNone) || ! !ROUTINE_IS_VALID(pHubRoutines, pPortName) || ! !ROUTINE_IS_VALID(pHubRoutines, pFilterName)) { return NULL; } + pMsgInsertVal = pHubRoutines->pMsgInsertVal; pMsgReplaceBuf = pHubRoutines->pMsgReplaceBuf; pMsgInsertBuf = pHubRoutines->pMsgInsertBuf; + pMsgReplaceNone = pHubRoutines->pMsgReplaceNone; + pMsgInsertNone = pHubRoutines->pMsgInsertNone; pPortName = pHubRoutines->pPortName; + pFilterName = pHubRoutines->pFilterName; return plugins; Index: telnet.vcproj =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/telnet/telnet.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** telnet.vcproj 9 Oct 2008 11:02:58 -0000 1.2 --- telnet.vcproj 24 Oct 2008 08:29:01 -0000 1.3 *************** *** 187,190 **** --- 187,198 ---- </File> <File + RelativePath=".\opt_comport.h" + > + </File> + <File + RelativePath=".\opt_termtype.h" + > + </File> + <File RelativePath="..\plugins_api.h" > *************** *** 209,212 **** --- 217,228 ---- </File> <File + RelativePath=".\opt_comport.cpp" + > + </File> + <File + RelativePath=".\opt_termtype.cpp" + > + </File> + <File RelativePath="..\plugins.def" > |
From: Vyacheslav F. <vf...@us...> - 2008-10-24 09:04:45
|
Update of /cvsroot/com0com/hub4com/examples In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10693 Added Files: com2tcp-rfc2217.bat Log Message: Initial revision --- NEW FILE: com2tcp-rfc2217.bat --- @ECHO OFF SETLOCAL IF DEFINED HUB4COM GOTO DEFINED_HUB4COM SET HUB4COM=hub4com :DEFINED_HUB4COM PATH %~dp0;%PATH% :BEGIN_PARSE_OPTIONS SET OPTION=%1 IF NOT "%OPTION:~0,2%"=="--" GOTO END_PARSE_OPTIONS SHIFT /1 IF /I "%OPTION%"=="--help" GOTO USAGE IF /I "%OPTION%" NEQ "--interface" GOTO END_OPTION_INTERFACE SET OPTIONS=%OPTIONS% --interface=%1 SHIFT /1 GOTO BEGIN_PARSE_OPTIONS :END_OPTION_INTERFACE IF /I "%OPTION%" NEQ "--rfc2217-mode" GOTO END_OPTION_RFC2217_MODE SET ARG=%1 SHIFT /1 IF /I "%ARG:~0,1%" NEQ "c" GOTO END_OPTION_RFC2217_MODE_CLIENT SET LC_CLIENT_MODE=yes GOTO BEGIN_PARSE_OPTIONS :END_OPTION_RFC2217_MODE_CLIENT IF /I "%ARG:~0,1%" NEQ "s" GOTO END_OPTION_RFC2217_MODE_SERVER SET LC_CLIENT_MODE=no GOTO BEGIN_PARSE_OPTIONS :END_OPTION_RFC2217_MODE_SERVER GOTO USAGE :END_OPTION_RFC2217_MODE GOTO USAGE :END_PARSE_OPTIONS :BEGIN_PARSE_ARGS IF "%1"=="" GOTO USAGE SET COMPORT=%1 SHIFT /1 IF "%1"=="" GOTO USAGE SET TCP=%1 SHIFT /1 IF "%1"=="" GOTO END_PARSE_ARGS SET TCP=%TCP%:%1 SHIFT /1 IF /I "%LC_CLIENT_MODE%"=="no" GOTO END_SET_LC_CLIENT_MODE SET LC_CLIENT_MODE=yes :END_SET_LC_CLIENT_MODE IF NOT "%1"=="" GOTO USAGE :END_PARSE_ARGS IF /I "%LC_CLIENT_MODE%"=="yes" GOTO SET_LC_CLIENT_MODE_OPTIONS SET TCP_TELNET_OPTIONS=:"--comport=server --suppress-echo=yes" SET TCP_LSRMAP=--create-filter=lsrmap,tcp,lsrmap SET TCP_PINMAP_OPTIONS=:"--cts=cts --dsr=dsr --dcd=dcd --ring=ring" SET TCP_LC_OPTIONS=:"--br=local --lc=local" SET COM_PINMAP_OPTIONS=:"--rts=cts --dtr=dsr --break=break" SET COM_LC_OPTIONS=:"--br=remote --lc=remote" GOTO END_SET_LC_MODE_OPTIONS :SET_LC_CLIENT_MODE_OPTIONS SET TCP_TELNET_OPTIONS=:"--comport=client" SET TCP_PINMAP_OPTIONS=:"--rts=cts --dtr=dsr --break=break" SET TCP_LC_OPTIONS=:"--br=remote --lc=remote" SET COM_PINMAP_OPTIONS=:"--rts=cts --dtr=dsr" SET COM_LC_OPTIONS=:"--br=local --lc=local" :END_SET_LC_MODE_OPTIONS SET TC=: %TC% SET OPTIONS=%OPTIONS% --create-filter=trace,com,COM SET OPTIONS=%OPTIONS% --create-filter=escparse,com,parse %TC% SET OPTIONS=%OPTIONS% --create-filter=trace,com,ExM SET OPTIONS=%OPTIONS% --create-filter=pinmap,com,pinmap%COM_PINMAP_OPTIONS% SET OPTIONS=%OPTIONS% --create-filter=linectl,com,lc%COM_LC_OPTIONS% %TC% SET OPTIONS=%OPTIONS% --create-filter=trace,com,CxT SET OPTIONS=%OPTIONS% --add-filters=0:com %TC% SET OPTIONS=%OPTIONS% --create-filter=trace,tcp,TCP SET OPTIONS=%OPTIONS% --create-filter=telnet,tcp,telnet%TCP_TELNET_OPTIONS% %TC% SET OPTIONS=%OPTIONS% --create-filter=trace,tcp,TxM SET OPTIONS=%OPTIONS% %TCP_LSRMAP% SET OPTIONS=%OPTIONS% --create-filter=pinmap,tcp,pinmap%TCP_PINMAP_OPTIONS% SET OPTIONS=%OPTIONS% --create-filter=linectl,tcp,lc%TCP_LC_OPTIONS% SET OPTIONS=%OPTIONS% --add-filters=1:tcp @ECHO ON "%HUB4COM%" %OPTIONS% --octs=off "%COMPORT%" --use-driver=tcp "*%TCP%" @ECHO OFF ENDLOCAL GOTO END :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :USAGE ECHO Usage (TCP client mode): ECHO %0 [options] \\.\^<com port^> ^<host addr^> ^<host port^> ECHO. ECHO Usage (TCP server mode): ECHO %0 [options] \\.\^<com port^> ^<listen port^> ECHO. ECHO Common options: 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 --help - show this help. ECHO. ECHO TCP client mode options: ECHO --interface ^<if^> - use interface ^<if^> for connecting. ECHO. ECHO TCP server mode options: ECHO --interface ^<if^> - use interface ^<if^> for listening. GOTO END :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :END |
From: Vyacheslav F. <vf...@us...> - 2008-10-24 09:03:17
|
Update of /cvsroot/com0com/hub4com In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11019 Modified Files: hub4com.vcproj Log Message: Added com2tcp-rfc2217.bat Index: hub4com.vcproj =================================================================== RCS file: /cvsroot/com0com/hub4com/hub4com.vcproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** hub4com.vcproj 16 Oct 2008 07:10:05 -0000 1.5 --- hub4com.vcproj 24 Oct 2008 09:02:15 -0000 1.6 *************** *** 303,317 **** > <File - RelativePath=".\examples\com2tcp-esc.bat" - > - </File> - <File - RelativePath=".\examples\com2tcp.bat" - > - </File> - <File RelativePath=".\ReadMe.txt" > </File> </Filter> </Files> --- 303,325 ---- > <File RelativePath=".\ReadMe.txt" > </File> + <Filter + Name="examples" + > + <File + RelativePath=".\examples\com2tcp-esc.bat" + > + </File> + <File + RelativePath=".\examples\com2tcp-rfc2217.bat" + > + </File> + <File + RelativePath=".\examples\com2tcp.bat" + > + </File> + </Filter> </Filter> </Files> |