2014-01-24 Corey Minyard * ser2net.h, Makefile.am: Move some things into a new ser2net.h file. * devcfg.c, controller.c, dataxfer.c, ser2net.c, utils.c: Add the ser2net.h include file. * dataxfer.c: Fix some EAGAIN handling. 2014-01-23 Corey Minyard * utils.h, readconfig.c, dataxfer.c: Rework the find_xxx functions to return a strdup of the string. * dataxfer.c, dataxfer.h, devcfg.h: Remove the dinfo structure and move the contents into the port structure, and remove the now empty devcfg.h. * configure.ac: Minor rework. 2014-01-22 Corey Minyard * io.h, devcfg.h, devcfg.c, dataxfer.c, buffer.c, buffer.h: Abstract the device I/O operations. * utils.c, utils.h, controller.h, controller.c: Fix some const correctness issues * conroller.c, controller.h: Add printf-style output. * dataxfer.h, dataxfer.c, devcfg.h, devcfg.c, io.h, readconfig: Rework the error and output handling to make it more flexible, so errors can be output with useful information from the lower levels. 2013-08-08 Corey Minyard * utils.c, utils.h, dataxfer.c, controller.c: Rework the handling of addresses to work properly with all the return values of getaddrinfo, and to prefer IPV6 over IPV4 when opening the socket. This means if you specify a number, it will open the IPV6 ::,port address first. This was a big cleanup, and moved a lot of the base socket handling into utils.h. * dataxfer.c: Rework the stdio handling so it doesn't rely on the port number in the address, since that is now gone. * dataxfer.c: Set port->closestr to NULL when freeing it to avoid a double-free. * readconfig.c, ser2net.8: Rework the input handling so an IPV6 can be specified as part of the portnum parameter. This was hard because IPV6 addresses have ':' in them. Basically, if there is a "," in the port specification, assume that everything from the beginning of the line to the ':' after the ',' is the port number. * utils.c, utils.h, dataxfer.c, controller.c: Modified address handling so that ser2net opens all the addresses returned by getaddrinfo, not just the first one. That should make things work correctly in a lot more cases. 2013-08-07 Corey Minyard * utils.c, controller.c, dataxfer.c: Return an errno from scan_tcp_port() so it can return an out of memory error. * controller.c, controller.h, ser2net.c: Add an out of memory return code from controller_init(). 2013-07-31 Longshine * utils.c: Copy input string to a temporary buffer before calling strtok_r in scan_tcp_port. 2013-07-28 Corey Minyard * configure.ac: Move to version 2.9.1. There was an issue with the configure setup. So autoreconf and redistribute. 2013-07-26 Corey Minyard * dataxfer.c: Fix a bug in format strings where hex element (\x) would have the wrong values for a-f. Pointed out by Galen Seitz. 2013-07-26 Corey Minyard * configure.ac: Version 2.9. 2013-07-25 Yegor Yefremov * Make RFC2217 signature configurable: Add '-s' option to configure default signature, that can be requested via RFC2217 protocol (option 0). Add per port signature via SIGNATURE keyword. 2013-06-29 Yegor Yefremov * dataxfer.c: The baudrate, that will be sent to the client, was converted twice: first with htonl() and then via copying to the buffer. As result 38400 was transfered as 6500960000 instead of 6500009600. 2013-05-07 Corey Minyard * buffer.c: Add a buffer wrap that was missed, identified by Brian Rzycki. 2013-03-01 Corey Minyard * Makefile.am: Added 'ACLOCAL_AMFLAGS = -I m4' as suggested by libtoolize. * configure.in -> configure.ac * configure.ac: Add 'AC_CONFIG_MACRO_DIR([m4])' as suggested by libtoolize. * configure.ac: Version 2.8. 2013-02-28 Corey Minyard * dataxfer.c, readconfig.c: Properly handle an empty string passed as a banner, openstr, or closestr. 2013-01-29 Corey Minyard * utils.h, utils.c: Have scan_tcp_port() take the domain. * dataxfer.c, controller.c: If the socket open fails with EAFNOSUPPORT, retry the address with IF_INET (IPV4-only). This way the call will still work even if IPV6 is disabled. 2012-12-19 Corey Minyard * README: Add info on how to generate configure and friends. 2012-12-13 Jordi Riera-Babures , Corey Minyard * devcfg.c: Add support for a bunch of high-speed baud rates. 2012-12-07 Corey Minyard * utils.c: Change hints.ai_family from AF_INET6 to AF_UNSPEC. That way it won't force IPV6, but it will return either. I think that's right. 2012-12-04 Corey Minyard * utils.c, utils.h: Modify scan_tcp_port to return the length of the socket info returned by getaddrinfo(). * controller.c, dataxfer.c: Use the length returned by scan_tcp_port(), not the size of sockaddr_storage, for the length of the socket information. 2012-09-26 Corey Minyard * configure.in: Move to 2.8-rc3 * dataxfer.c, dataxfer.h, selector.c, selector.h, ser2net.c: Add clean shutdown handling so locks are properly removed when the program is killed with SIGINT. * dataxfer.c: Modify the lock files to be Linux FHS compiliant. 2012-09-10 Corey Minyard * dataxfer.c: Fix a bug reported by Jan-Benedict Glaw, where port->dinfo.openstr may be NULL, but srdup is called on it without checking. Add a check. 2012-07-23 qchats lee * dataxfer.c: My change for this did not match Qchats' change, so fix that. * utils.c: Fix the write_full() function to handle the return result properly; the parenthesis in the if statement ended in the wrong place. 2012-07-22 qchats lee * dataxfer.c: Add a missing ")" after the "OPEN(..." when header tracing. 2012-04-18 Corey Minyard * buffer.c, buffer.h, Makefile.am: Added a new type and set of operations for buffer handling. This simplifies and allows abstraction of other parts of the code. * dataxfer.c, telnet.c, telnet.h, controller.c: Switch out_telnet_cmd and associated parts to be the new buffer type. * dataxfer.c: Switch the banner over to the new buffer type. * dataxfer.c: Consolidate banner and filename string handling. Note that there was an issue with \s, as it was something different in banners and filenames. Added new options, \S (for seconds) and \B (for serial port parameters) to resolve this issue, and \s is backwards compatible but deprecated. * ser2net.8, ser2net.conf: Since the consolidated banner/filename processing allows all the \ options to be available for both banners and filenames, rework the documentation. * dataxfer.c: Convert the main I/O buffers for data transfer to the new buffer type. * devcfg.h, devcfg.c, readconfig.c, utils.h: Added a new OPENSTR and CLOSESTR option for the configuration file. These are strings that will be transmitted to the device when a port is opened and/or closed. * ser2net.8, ser2net.conf: Added docs for the OPENSTR and CLOSESTR options. * dataxfer.c: Handle the new OPENSTR and CLOSESTR options. This required adding a new state, PORT_CLOSING, for the tcp_to_dev_state to say that the port is closing but data is going out, and splitting up the shutdown handling. * utils.c: Fixed a bug that cause the "port in use" error on the TCP connection to be printed strangely. * dataxfer.c: Since the banner handling no longer depends on being able to put the whole banner in the output buffer, reduce the port buffer sizes to 64 bytes to reduce memory usage * selector.c: maxfd was not initialized for a selector, fix that. * configure.in: Move to 2.8-rc2. 2012-04-04 Corey Minyard * dataxfer.c: Turn on the tcp write handler at first for raw sockets, otherwise the banner won't come out till some data comes in on the port. 2012-04-03 Corey Minyard * devcfg.c: Add 600 baud. 2012-03-27 Corey Minyard * ser2net.c, readconfig.c, ser2net.h, controller.c, ser2net.conf: Add a method to specify the control port in the ser2net config file. * dataxfer.c, controller.c: Add SO_KEEPALIVE to socket connections so the connection will drop if the other end just goes away. * configure.in: Move to 2.8-rc1. 2011-08-12 Corey Minyard * dataxfer.c: Fix some unaligned write issues in telnet options. * dataxfer.c: Fix some signed/unsigned comparison issues and a typo. 2011-06-22 Corey Minyard * utils.h, utils.c, controller.c, dataxfer.c: Fix some warnings about the write() return value not being checked. These were almost all cases where a failure didn't matter (tracing), except for writing the pid file, where it should have been a handled failure. * dataxfer.c: Cleaned up some style issues in the UUCP locking code. * ser2net.c: Fixed a warning about not checking the chdir() return code, and added some improved logging information to syslog. 2010-03-11 Mats Erik Andersson , Corey Minyard * controller.c, dataxfer.c, utils.c, utils.h: Add IPV6 address compatability. 2009-11-12 Corey Minyard * ser2net.spec, ser2net.spec.in: Fix the version in the spec file to be updated automatically. 2009-11-12 Philip Gwyn * dataxfer.c, devcfg.c, devcfg.h, ser2net.8: Add the ability to dump trace files in a binary format with timestamps. 2009-11-03 Corey Minyard * configure.in: Move version to 2.7 for release. 2009-10-23 Corey Minyard * configure.in: Move to 2.7-rc3. * dataxfer.c, devcfg.c, devcfg.h, ser2net.h: Modified the tb= directive to work separately from tw= and tr=, so you can do all three at the same time independently. * readconfig.c: Improved an error report. 2009-10-22 Corey Minyard * ser2net.c: Set up routing errors to stderr before reading the config so config errors come out properly to stdout. * ser2net.8, ser2net.conf: Fix the documentation, it's tw=, not tw: for the tracefile stuff. * configure.in: Move to 2.7-rc2. 2009-10-15 Corey Minyard * dataxfer.c, devcfg.c, readconfig.c, ser2net.8, ser2net.conf: Add the ability to trace data read written to trace files. 2009-07-19 Geoff Simmons * ser2net.conf: Some documentation cleanup, added missing docs for the timeout parameter. * README - Minor doc cleanup. 2009-07-15 Corey Minyard * configure.in: Move to version 2.6. 2009-06-30 Corey Minyard * dataxfer.c, devcfg.c, devcfg.h, readconfig.h, utils.h: Add the a TRACEFILE option to trace all I/O to a file., and separate out the defconfig into a separate structure to avoid passing a boatload of things to the config. 2009-06-30 Sebastian Andrzej Siewior * controller.c: Fix use after free in controller The controller will use its dynamically allocated data after it got free() in error path. What we see in syslog is: Jun 30 10:26:38 consrv3 ser2net[3073]: read error for controller port: Connection reset by peer Jun 30 10:26:39 consrv3 ser2net[3073]: The tcp write for controller had error: Bad file descriptor The first error is "legal" because the destitnation decided to close its socket a little to early than expected. The second error is allready bad because it tries to use allready deallocated fd. Later we segfault. 2007-11-16 Corey Minyard * configure.in: Move to version 2.5. 2007-11-16 Harry Flick, Corey Minyard * devcfg.c, devcfg.h, dataxfer.c, ser2net.conf, ser2net.8: Allow a "NOBREAK" option to disable automatically messing with the break operations on the serial port. Useful for systems with a broken break. 2007-11-16 Robert Edmonds ,Corey Minyard * ser2net.c, ser2net.8: Add a '-P' option to specific that a pidfile be created. 2007-05-03 Corey Minyard * dataxfer.c: Change the rfc2217 signature response code from 0 to 100. Best guess on what this should be, as the RFC doesn't give the correct value and says "text". 2007-04-26 Corey Minyard * dataxfer.c: Disable the Nagle algorithm (enable TCP_NODELAY) on the TCP ports to avoid long delays on short pieces of data. * configure.in: Move to version 2.4. 2007-03-19 Corey Minyard * dataxfer.c: Use the proper value for modem data notifies sent to the client, it was 7, use 107 instead. 2006-12-01 Corey Minyard * readconfig.c: Handle an ending banner that does not have a '\n' in the last line. 2006-01-16 Corey Minyard * ser2net.8: Fix the documentation for control ports. 2006-01-09 Corey Minyard * dataxfer.c: Don't kill the session if TIOCCBRK doesn't work. 2005-12-29 Corey Minyard * dataxfer.c, devcfg.c, devcfg.h, ser2net.conf, ser2net.8: Added a '\s' banner token for printing out the serial parameters. * ser2net.conf: Cleaned up the ugly banner3. * Makefile.am: Add ser2net.init to EXTRA_DIST. * configure.in: Move to version 2.3. 2005-12-29 Aurelien Jarno * devcfg.c: Don't include "termio.h", but do include "sys/ioctl.h". 2005-10-20 Corey Minyard * dataxfer.c: Fixed a problem with rfc2217 stop bit size setting. It was interpreting the value of "3" as 2 stop bits, but 3 is for 1.5 stop bits, and 2 is for 2 stop bits. * controller.c: Fixed some warnings dealing with char/unsigned char problems. * dataxfer.c: ditto * telnet.c: ditto 2005-08-25 Corey Minyard * dataxfer.c: Fix a problem wih EAGAIN just returning and not retrying the operation on writing data that has just been read. Thanks to Shinlun Hsieh for pointing this out. 2005-07-07 G Goodwill * dataxfer.c, devcfg.c: Added support for cygwin. 2005-07-07 Rajiv Aaron Manglani * configure.in: Make the use of tcp wrappers optional. 2005-06-13 Yura Kalinichenko * controller.c, devcfg.c, ser2net.8, ser2net.conf: Added 57600 baud support. * dataxfer.c: Don't to breaks on printer lines. 2005-02-12 Corey Minyard * configure.in: Move to version 2.2. 2005-02-11 Corey Minyard * dataxfer.c: Add a missing break statement after case 7 in the com_port_handler() function. 2004-11-29 Corey Minyard * dataxfer.c: Remove UUCP lock if the setup of the device fails. 2004-05-08 Marc Haber * ser2net.h: Set the man page section to the right value. 2004-01-24 Corey Minyard * dataxfer.c: Don't attempt to disconnect an unconnected port. 2003-12-20 Corey Minyard * dataxfer.c, ser2net.8: Added the ability to have port 0 mean use standard in/out. This way, you can invoke ser2net from inetd. * devcfg.c: Allow "," to be used as an option separator. * readconfig.c: Fix handling of lines coming from "-C". * ser2net.c: Move creation of the selector to before the option processing, for support of "-C'. 2003-12-19 Corey Minyard * dataxfer.c: Handle receive IACs from the terminal to the TCP port, duplicating them so they will come through right. * telnet.c: Reset the telnet protocol state after two IACs are received. * readconfig.c, readconfig.h, ser2net.c, ser2net.8: Added a way to specify individual config lines on the command line so that no config file is necessary. 2003-12-04 Corey Minyard * dataxfer.c: Add responses for all the telnet com port control commands that we handle. * telnet.c: Fixed IAC processing in suboption to be able to handle a stream of IACs properly. 2003-12-04 Corey Minyard * configure.in: Moved to version 2.1. * dataxfer.c: Have the telnet option responses use the 1xx responses to the com port control options. I believe this is wrong, but it is consistent with other products already in the field. * dataxfer.c, ser2net.c, telnet.h: Added support for setting the use of Cisco IOS baud rates instead of RFC 2217 ones, by command option. * selector.c, ser2net.c: Cleaned up some compile warnings. 2003-10-14 Corey Minyard * configure.in: Moved to version 2.0. * datafer.c, devcfg.c, devcfg.h, readconfig.c, utils.h: Added banner support. * ser2net.h, ser2net.conf: Added documentation for banner support. * dataxfer.c, telnet.c, telnet.h: Created a more generic telnet command handler and split it off from dataxfer.c * controller.c: Moved to the new telnet command handler. * dataxfer.c: Added watching the CD, RI, etc. lines. 2003-10-13 Corey Minyard * dataxfer.c: Added a lot of the com port control handling. 2003-10-12 Corey Minyard * dataxfer.c: Added real telnet option processing infrastructure, getting read for com port control handling. 2003-04-22 Corey Minyard * configure.in, ser2net.spec: Move to version 1.9. * selector.c: Turned off debugging code that accidentally got left on. 2003-02-14 Corey Minyard * configure.in, ser2net.spec: Move to version 1.8. * dataxfer.c: Do a tcflush(fd, TCOFLUSH) before closing the serial device, this avoids blocking on close. 2002-11-29 Corey Minyard * selector.c: More timer heap bugs. 2002-10-01 Corey Minyard * selector.c: Fixed bugs in the timer heaps. 2002-09-23 Corey Minyard * selector.c: Fixed a bug in the timer heaps. 2002-09-09 Corey Minyard * all: Reworked the selector code to make timers more general. 2002-07-24 Corey Minyard * dataxfer.c: Fixed a bug with handling config errors, when an error occurs in the wrong place it will segv. 2002-04-04 Corey Minyard * util.c: added the final return value to scan_tcp_port. 2002-02-20 Corey Minyard * controller.c, dataxfer.c, dataxfer.h, ser2net.8: Added a "short" display, where each port is shown on one line. * dataxfer.c, dataxfer.h, readconfig.c, selector.c, selector.h, ser2net.8, ser2net.c: Added the ability to reread the configuration file on a SIGHUP. * configure.in, ser2net.spec: Moved to version 1.6 2002-02-20 Przemyslaw Czerpak (druzus@polbox.com), Corey Minyard * dataxfer.c, dataxfer.h, configure.in, ser2net.c, ser2net.8: Added UUCP-style locking for ports. 2002-02-19 Corey Minyard * controller.c, controller.h, dataxfer.c, devcfg.c, ser2net.c, ser2net.conf, ser2net.8, utils.c utils.h: Added support for specifying the IP address with the port to bind to specific interfaces. * dataxfer.c: Added counting the input and output bytes. 2002-02-19 Przemyslaw Czerpak (druzus@polbox.com) * controller.c, dataxfer.c, devcfg.c, ser2net.c, ser2net.conf, ser2net.8: Added support for turning on/off RTS/CTS, XON/XOFF, and LOCAL. Also added support for raw LP devices. 2001-10-05 Przemyslaw Czerpak (druzus@polbox.com) * controller.c, dataxfer.c, devcfg.c, ser2net.init, ser2net.spec: Added an init, and cleaned up a bunch of type warnings. * devcfg.c, ser2net.8, ser2net.conf: Added support for RTS/CTS. 2001-08-11 Corey Minyard * devcfg.h, devcfg.c, controller.c, dataxfer.c, dataxfer.h, ser2net.8: Ben Adams sent a patch to control the DTR and RTS lines, I rewrote it to make a new command to do this (instead of using devconfig, which didn't really match the devconfig's operation). * configure.in, ser2net.spec: Updated to version 1.5 2001-07-26 Corey Minyard * devcfg.c - Added CREAD to the cflags so the serial port will work, patch from Andreas Pfaller. * dataxfer.c - Added binary transmission to the list of telnet opeions, again from Andreas Pfaller. 2001-07-23 Corey Minyard * devcfg.c, ser2net.8, ser2net.conf - Added a patch from Martin Boese to add CLOCAL and XON/XOFF support as serial port options. 2001-07-03 Corey Minyard * Makefile.am, ser2net.1, ser2net.8, ser2net.spec - Moved ser2net to /usr/sbin, renamed the makefile to have a .8 extension and put it in /usr/share/man. * controller.c - Fixed problems with telnet handling in the control interface. * Updated to version 1.4 2001-06-29 Corey Minyard * ser2net.spec - Actually put the changed version number in the file, set the prefix to '/usr'. * configure.in - Added libnsl for Redhat systems, changed to AC_CHECK_LIB. * all - changed to version 1.3. 2001-06-28 Corey Minyard * dataxfer.c - Added the ability to convert a telnet break to a serial port break. * configure.in - Updated to version 1.3 * ser2net.spec - Added this file for RPM building, from Ivan Francolin Martinez. * dataxfer.c - Added a tcp_wrappers implementation, from Ivan Francolin Martinez. However, some configure work needs to be done to make it actually work properly. * dataxfer.c, controller.c, configure.in, ser2net.1 - Fixed the tcp_wrappers stuff to work properly, did the config stuff for it, and added it to the control port as well. 2001-06-15 Corey Minyard * controller.c - Made sure the monitor port was set to null when the port exited. * ser2net.c, ser2net.1 - Added a "-d" option to send debug output to the console and modified "-n" to just not detach. 2001-06-05 Corey Minyard * ser2net.c, controller.c - added a way to query the version from the command line and from the controller port. * controller.c, controller.h, dataxfer.c, dataxfer.h - added monitoring of data flowing into a port. It's somewhat primitive yet, but still useful * controller.c, dataxfer.c, dataxfer.h - added a way to disconnect a port from the control port. 2001-06-04 Corey Minyard * Initial creation.