Import sredird 2.2.2

Sredird is a serial port redirector that is compliant with the RFC 2217
"Telnet Com Port Control Option" protocol. This protocol lets you share
a serial port through the network.

From Alexey E. Suslikov <alexey.suslikov@gmail.com>
This commit is contained in:
alek 2006-06-29 10:53:08 +00:00
parent 27dad91186
commit 59b1318a66
7 changed files with 114 additions and 0 deletions

31
comms/sredird/Makefile Normal file
View File

@ -0,0 +1,31 @@
# $OpenBSD: Makefile,v 1.1.1.1 2006/06/29 10:53:08 alek Exp $
COMMENT= "RFC 2217 compliant serial port redirector"
DISTNAME= sredird-2.2.2
CATEGORIES= comms
MAINTAINER= Alexey E. Suslikov <alexey.suslikov@gmail.com>
# GPL
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB= c
MASTER_SITES= http://www.ibiblio.org/pub/Linux/system/serial/
NO_REGRESS= Yes
pre-build:
@perl -pi -e "s,%%LOCALBASE%%,${LOCALBASE},g" ${WRKSRC}/sredird.8
do-build:
${CC} ${CFLAGS} -Wall -o ${WRKSRC}/sredird ${WRKSRC}/sredird.c
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/sredird ${PREFIX}/libexec
${INSTALL_MAN} ${WRKSRC}/sredird.8 ${PREFIX}/man/man8
.include <bsd.port.mk>

4
comms/sredird/distinfo Normal file
View File

@ -0,0 +1,4 @@
MD5 (sredird-2.2.2.tar.gz) = e541e4b1cb9fa8fc8ff0e76bb1127cda
SHA1 (sredird-2.2.2.tar.gz) = 90ed6cc61273a0c52c0da0ebb11e020ed119cf1e
RMD160 (sredird-2.2.2.tar.gz) = 8b8d9f62a5d653cbf43758380dadbf9b087c9a26
SIZE (sredird-2.2.2.tar.gz) = 25495

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-sredird_8,v 1.1.1.1 2006/06/29 10:53:08 alek Exp $
--- sredird.8.orig Mon Jun 19 12:44:13 2006
+++ sredird.8 Mon Jun 19 12:59:13 2006
@@ -29,8 +29,11 @@
.I sredird.
.SH "EXAMPLE"
-Here is a configuration line for running it from inetd:
-sredir stream tcp nowait root /usr/sbin/tcpd /usr/sbin/sredird 5 /dev/modem /var/lock/LCK..modem
+The following configuration line for
+.I inetd.conf
+will start sredird on port 2001 and attach it to serial port cua00:
+.P
+:2001 stream tcp nowait root %%LOCALBASE%%/libexec/sredird sredird 5 /dev/cua00 /var/spool/lock/LCK..cua00
.SH "AUTHOR"
This man page was written by Russell Coker <russell@coker.com.au>. May be

View File

@ -0,0 +1,46 @@
$OpenBSD: patch-sredird_c,v 1.1.1.1 2006/06/29 10:53:08 alek Exp $
--- sredird.c.orig Fri Aug 12 16:10:46 2005
+++ sredird.c Sun Jun 18 02:10:10 2006
@@ -110,9 +110,9 @@
#include <fcntl.h>
#include <syslog.h>
#include <termios.h>
-#include <termio.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
@@ -714,8 +714,6 @@ unsigned long int GetPortSpeed(int PortF
return(115200UL);
case B230400:
return(230400UL);
- case B460800:
- return(460800UL);
default:
return(0UL);
}
@@ -1094,9 +1092,6 @@ void SetPortSpeed(int PortFd, unsigned l
case 230400UL:
Speed = B230400;
break;
- case 460800UL:
- Speed = B460800;
- break;
default:
LogMsg(LOG_WARNING,"Unknwon baud rate requested, setting to 9600.");
Speed = B9600;
@@ -2024,10 +2019,10 @@ int main(int argc, char * argv[])
*/
SockParm = IPTOS_LOWDELAY;
setsockopt(STDIN_FILENO,SOL_SOCKET,SO_KEEPALIVE,&SockParmEnable,sizeof(SockParmEnable));
- setsockopt(STDIN_FILENO,SOL_IP,IP_TOS,&SockParm,sizeof(SockParm));
+ setsockopt(STDIN_FILENO,IPPROTO_IP,IP_TOS,&SockParm,sizeof(SockParm));
setsockopt(STDIN_FILENO,SOL_SOCKET,SO_OOBINLINE,&SockParmEnable,sizeof(SockParmEnable));
setsockopt(STDOUT_FILENO,SOL_SOCKET,SO_KEEPALIVE,&SockParmEnable,sizeof(SockParmEnable));
- setsockopt(STDOUT_FILENO,SOL_IP,IP_TOS,&SockParm,sizeof(SockParm));
+ setsockopt(STDOUT_FILENO,IPPROTO_IP,IP_TOS,&SockParm,sizeof(SockParm));
/* Make reads/writes unblocking */
ioctl(STDOUT_FILENO,FIONBIO,&SockParmEnable);

6
comms/sredird/pkg/DESCR Normal file
View File

@ -0,0 +1,6 @@
Sredird is a serial port redirector that is compliant with the RFC 2217
"Telnet Com Port Control Option" protocol. This protocol lets you share
a serial port through the network.
RFC 2217 was orginally implemented in Cisco Terminal Servers in IOS
version 11.x.

View File

@ -0,0 +1,7 @@
You may wish to add the following line to /etc/inetd.conf:
:2001 stream tcp nowait root ${PREFIX}/libexec/sredird \
sredird 5 /dev/cua00 /var/spool/lock/LCK..cua00
which will start sredird on port 2001 and attach it to serial
port cua00.

3
comms/sredird/pkg/PLIST Normal file
View File

@ -0,0 +1,3 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2006/06/29 10:53:08 alek Exp $
libexec/sredird
@man man/man8/sredird.8