{"id":18151229,"url":"https://github.com/msantos/sredird","last_synced_at":"2025-04-28T17:40:30.267Z","repository":{"id":136621522,"uuid":"304606307","full_name":"msantos/sredird","owner":"msantos","description":"RFC 2217 network serial port redirector","archived":false,"fork":false,"pushed_at":"2024-12-31T13:32:51.000Z","size":111,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T11:41:34.238Z","etag":null,"topics":["capsicum","pledge","rfc2217","seccomp","serial","setrlimit"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msantos.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-16T11:25:13.000Z","updated_at":"2024-12-31T13:32:55.000Z","dependencies_parsed_at":"2023-11-26T14:54:14.138Z","dependency_job_id":"be55c8d0-fdc1-4663-8771-c75c65ae82e6","html_url":"https://github.com/msantos/sredird","commit_stats":{"total_commits":71,"total_committers":1,"mean_commits":71.0,"dds":0.0,"last_synced_commit":"8398a9a0a5af95a492439528426e05f4b1e1435e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msantos%2Fsredird","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msantos%2Fsredird/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msantos%2Fsredird/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msantos%2Fsredird/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msantos","download_url":"https://codeload.github.com/msantos/sredird/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251357411,"owners_count":21576701,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capsicum","pledge","rfc2217","seccomp","serial","setrlimit"],"created_at":"2024-11-02T01:07:01.701Z","updated_at":"2025-04-28T17:40:30.245Z","avatar_url":"https://github.com/msantos.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"sredird: RFC 2217 compliant serial port redirector\nVersion 2.2.1, 20 February 2004\nCopyright (C) 1999-2003 InfoTecna s.r.l.\nCopyright (C) 2001, 2002 Trustees of Columbia University\nin the City of New York\n\n1 - Disclaimer\n\nThis program is free software; you can redistribute it and/or modify it\nunder the terms of the GNU General Public License as published by the\nFree Software Foundation; either version 2 of the License, or (at your\noption) any later version.\n\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\nor FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\nfor more details.\n\nYou should have received a copy of the GNU General Public License along\nwith this program; if not, write to the Free Software Foundation, Inc.,\n675 Mass Ave, Cambridge, MA 02139, USA.\n\nTo contact the authors:\n\n  Denis Sbragion\n  InfoTecna\n  Tel, Fax: +39 0362 805396\n  URL: http://www.infotecna.it\n  E-Mail: d.sbragion@infotecna.it\n\n  Jeffrey Altman\n  Columbia University\n  URL:  http://www.columbia.edu/kermit/\n  E-mail: kermit-support@columbia.edu\n\n\n2 - Introduction\n\nSredird is a serial port redirector that is compliant with the RFC 2217\n\"Telnet Com Port Control Option\" protocol. This protocol lets you share\na serial port through the network. RFC 2217 was originally implemented\nin Cisco Terminal Servers in IOS version 11.x.\n\nRFC 2217 clients include:\n\n . C-Kermit 8.0 for Unix,VMS,QNX,... \n   \u003chttp://www.columbia.edu/kermit/ckermit.html\u003e\n\n . DialOut/IP V2, a commercial Windows 95/98/NT client. \n   \u003cwww.tacticalsoftware.com\u003e\n\nInformation on RFC 2217 and the Telnet Protocol is available at www.ietf.org.\n\n3 - Compilation\n\nJust compile the sredird.c file with your favorite compiler and your\nfavorite optimizations options. Under Linux a line like:\n\ngcc -O3 -m486 -pipe -fomit-frame-pointer\n\nshould do the job. Rename the output (usually a.out) to sredird.\nYou can also try the supplied Makefile. Check it for compiler option\nbefore running the make command.\n\n4 - Command line parameters\n\nSredird takes three mandatory parameters and two optional parameters, \none at the beginning and one at the end of the command line.\n\nThe mandatory parameters are:\n\nLog level: 0 to 7, 0 being no log and 7 being debug log. Sredird uses\nthe standard syslog facility for logging. Look at the syslog(3) man page\nfor further information on the syslog facility and log levels.\n\nDevice: the device complete path. Something like /dev/ttyS0 or /dev/modem.\n\nThe optional parameters are:\n\n- At the beginning of the command line:\n\nA -i option enables compatibility with the Cisco IOS which has a small\nbug in the handling of the inbound flow control.\n\n- At the end of the command line:\n\nPoll interval: sredird checks for line state changes (DSR/CTS/DCD/RNG)\non every single char sent on the serial line. To prevent losing state\nchange when there's no traffic on the serial port, sredird also polls\nthe line state when there's no traffic on the line for more than the\npoll interval. The value is in milliseconds and the default is 100\nmilliseconds. Setting it to 0 disables the polling feature. This is\nalso the maximum time data is left in the output buffer before sending\nit, even if the buffer isn't completely full, so the polling interval\nglobally sets the maximum latency of any sredird action.\n\n5 - Installation\n\nPut the executable in a suitable directory (/usr/sbin or /usr/local/sbin).\nSredird is designed to run under inetd control. The line in the inetd\nconfiguration file (usually /etc/inetd.conf) should look like this:\n\nsredir          stream  tcp     nowait  root    /usr/sbin/tcpd /usr/sbin/sredird -i 5 /dev/modem\n\nOf course, \"sredir\" should be defined in the services file (usually\n/etc/services, usual values start at port 7000) and \"/dev/modem\" should\nbe substituted by the appropriate device. The lock and the device name\nmust match for correct interlocking with other programs. The tcpd program\nis the usual tcp wrapper that's not needed for correct operation but\nis useful for security purposes. Don't forget to send a SIGHUP to the\ninetd daemon in order to force reload of the configuration file. The\ninitial -i parameter is optional and enables compatibility with the\nCisco IOS.\n\n6 - Bugs\n\nPatches, bug reports, comments, improvements and anything else are welcome.\n\n7 - Outstanding issues\n\nThe RFC 2217 protocol is a rather complete protocol that provides a lot\nof features. Most of them are implemented in sredird but some seldom\nused options are missing:\n\n . does not properly check implement BREAK handling.  Need to figure\n   out how to turn a BREAK on and then off based upon receipt of \n   COM-PORT Subnegotiations\n\n . does not properly use select to handle input, output and\n   errors on all devices.\n\n . Lack of login processing\n\n . Lack of Telnet START_TLS to protect the data stream\n\n . Lack of Telnet AUTHENTICATION\n\n . LineState processing is not implemented\n\n . The code probably won't compile on most versions of Unix due to the\n   highly platform dependent nature of the serial apis.\n   The program has been tested only under Linux 2.0.36, gcc 2.7.2.1,\n   libc5 and RedHat 5.2/7.1 but should work on any POSIX compliant \n   operating system.\n\n . Use of polling to notify change on the serial control lines is not\n   desirable.  Anyone know of an event driven mechanism for discovering\n   modem and line signal changes?\n\n . Better documentation and a man page would be useful.\n\n8 - Implementation Notes\n\n . Setting the port to 1.5 stop bits isn't supported. When requested,\n   1 stop bit is set and returned as the response value.\n\n . Setting the parity to mark or space isn't supported.  When requested,\n   Parity is set to None and returned as the response value.\n\n . DTR, DSR and DCD flow control isn't supported.  When requested, \n   flow control is disabled and \"no flow control\" is returned as the\n   response value.\n\n . RFC 2217 supports the ability for the Input and Output Parity and\n   Flow control settings to be independent of each other.  This is not\n   supported by the majority of serial port UARTs available on the market\n   and is not supported by sredird.  Sredird ignores all requests to set\n   the Input Parity and Flow control.  The Output values are used for \n   both input and output as specified in the RFC.\n\n . DialOut/IP V2 version 2.0.0 has a known bug that prevent it from \n   running at 115200 baud. If you ask for 115200 baud it sets the serial\n   line at 9600 baud. It also has some other small bugs that cause it to\n   crash or fail under some rare circumstances. Use Version 2.0.2 or \n   higher to avoid this problem.\n\n9 - Credits\n\nThanks to David Yon and Mike Krueger of Tactical Software for their help\nin the sredird developing process. Thanks also to Tactical Software for\nits wonderful DialOut/IP package and for choosing an open standard for it.\nTactical Software provides also some other useful communication tools\nand an RFC 2217 compliant server for the Windows environment. Browse\nhttp://www.tacticalsoftware.com for more information.\n\nNordic Messaging Tech. AB provides a complete commercial RFC 2217\ncompliant server for various operating systems including Linux. See\nhttp://www.nordicmessaging.com for more information.\n\nImplementation of the Telnet State Machines, corrections to RFC 2217,\ntesting against various clients and comparison to hardware implementations\nin Cisco IOS software was performed by the Kermit Project at Columbia \nUniversity.  The Kermit Project provides the only known client implementation\nof RFC 2217 for Unix in its C-Kermit and Kermit 95 Telnet clients.  See\nhttp://www.columbia.edu/kermit/ for further details.\n\nThanks to Mario Viara for fixing some long lasting small bugs.\n\nThanks to Russell Coker for providing a man page, a better makefile and\nsome other small patches. \n\n10 - Commercial support\n\nInfoTecna (http://www.infotecna.it) is a commercial company and\nprovides commercial support for the sredird package. Sorry, but we really\nhave no time to provide free support apart for bug correction.\n\nThe Kermit Project provides support for C-Kermit and will provide support\nfor sredird when used in conjunction with Kermit software.\n\n11 - History\n\n01 June 1999 - Version 1.0.0: First stable release.\n\n02 June 1999 - Version 1.0.1: Corrected a bug on the stop size detection\nfunction. Corrections and exstensions to the documentation. Added credits\nto Tactical Software and Nordic Messaging.\n\n07 June 1999 - Version 1.1.0: Added errno.h to the list of the\ninclude files.  Thanks to Federico Bianchi (f.bianchi@arte.unipi.it)\nfor this. Added an internal buffering scheme, along with handling of the\nRFC 2217 FLOWCONTROL-SUSPEND and FLOWCONTROL-RESUME, to reduce network\nlatency caused by TCP and socket buffering. Added also some socket options\nto further reduce network latency. Fixed a bug on the polling feature.\n\n09 June 1999 - Version 1.1.3: Added an output buffer scheme that provides\nboth low latency, depending on the polling interval, and reasonable cpu\nconsumption without limiting the global throughput. Some other minor\nbug fixing.\n\n11 June 1999 - Version 1.1.4: Fixed compilation under SCO OpenServer\nand SCO like distributions (Red Hat). Thanks to Anthony Veale\n(aveale@hotmail.com) and Harri Vartiainen (harriv@sci.fi) for reporting\nthe problem and testing the fixed version. Fixed some other minor bugs.\n\n18 June 1999 - Version 1.1.5: SCO support abandoned. Providing SCO\nsupport would require huge changes to the code. Minor cosmetic and\ndocumentation changes.\n\n04 September 1999 - Version 1.1.6: Corrected an important bug where \nbytes directed to the socket were sent to the modem, then read back\nthrough the modem device and finally sent to the socket macking things\napparently working. Many thanks to Ayman Akt (ayman@uniware.com.au)\nfrom UniWare (www.uniware.com.au) for discovering this nasty bug.\n\n20 September 1999 - Version 1.1.7: Improved handling of the clocal \ntty flag.\n\n09 November 2000 - Version 1.1.8: Corrected a bug in the telnet option\nnegotiation code. Many options were always incorrectly negotiated as\nTN_TRANSMIT_BINARY. Thanks to David Yon (yon@rfdsoftware.com) for his\nbug report. Changed the default speed to 9600 baud instead of 38400 when\nan unknown baud rate is asked by the client. Furthermore now SRedird try\nto serve anyway when the client refuse the Com Port Control option. Added\na simple makefile. Thanks to Kevin Bertram (kevin@cate.com.au) for\nsuggesting this improvements and supplying the makefile. Changed e-mail\nand web references everywere.\n\n14 January 2002 - Version 2.0.0, fixes the following bugs:\n\n . Cisco IOS returns 0 to the client when INBOUND flow control is SET but\n   not supported separately from OUTBOUND.\n  \n . Telnet negotiations are used alter the states of both the client\n   and the server.  sredird did not implement a Telnet state machine\n   as required by RFC 854.  Version 2.0 adds support for a state\n   machine.\n\n . Version 1.1.8 corrected the negotiation of Telnet Binary mode\n   (RFC 856).  However, it never implemented it.  This is now \n   corrected.\n\n . Telnet DO ECHO should not be refused.  The modem handles the echoing\n   if necessary.\n\n . RFC 2217 allows the server (sredird) to give control over a serial\n   port to the client (server in DO mode).  It also allows the client\n   to give control over a serial port to the server (server in WILL mode).\n   sredird required both modes even though sredird only offers control\n   over a serial port.\n\n . sredird did not properly implement flow control.  Buffering was only\n   implemented when writing data to the serial port.  Data was not \n   buffered when reading data from the serial port.  This could have\n   resulted in inadvertent blocking.  Proper select() driven reads\n   and writes are now implemented.\n\n14 November 2002 - Version 2.1.0:\n\n . GetPortFlowControl should return 1 to indicate NO FLOW CONTROL\n   instead of 0.\n\n . The Cisco IOS hack should become activated only if set by command-\n   line option [-i].\n\n . Changed the order of checks in the EscWriteChar function for slightly\n   better performance\n\n09 July 2003 - Version 2.2.0\n\n . Applied the patch provided by Marco Viaria\n\n . Applied the patch supplied by Russell Coker\n\n20 February 2004 - Version 2.2.1\n\n . Minor bug correction, reported by Peter Astrand\n\n--\n\n  Denis Sbragion\n  InfoTecna\n  Tel, Fax: +39 0362 805396\n  URL: http://www.infotecna.it\n  E-Mail: d.sbragion@infotecna.it\n\n  Jeffrey Altman\n  Columbia University\n  URL:  http://www.columbia.edu/kermit/\n  E-mail: kermit-support@columbia.edu\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsantos%2Fsredird","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsantos%2Fsredird","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsantos%2Fsredird/lists"}