linux-decnet-commit Mailing List for DECnet for Linux (Page 33)
Brought to you by:
chrissie_c,
ph3-der-loewe
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(20) |
Feb
(27) |
Mar
(25) |
Apr
(12) |
May
(2) |
Jun
(6) |
Jul
(36) |
Aug
(12) |
Sep
(12) |
Oct
(16) |
Nov
(5) |
Dec
(5) |
2003 |
Jan
(8) |
Feb
(9) |
Mar
(25) |
Apr
(18) |
May
(29) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
(10) |
Oct
(5) |
Nov
(3) |
Dec
(9) |
2004 |
Jan
(17) |
Feb
|
Mar
(9) |
Apr
|
May
(4) |
Jun
(1) |
Jul
(2) |
Aug
(21) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2005 |
Jan
(5) |
Feb
|
Mar
(13) |
Apr
|
May
(3) |
Jun
(1) |
Jul
|
Aug
|
Sep
(13) |
Oct
(83) |
Nov
(2) |
Dec
|
2006 |
Jan
(21) |
Feb
(1) |
Mar
(32) |
Apr
(31) |
May
(3) |
Jun
(1) |
Jul
|
Aug
(7) |
Sep
|
Oct
(1) |
Nov
(3) |
Dec
(13) |
2007 |
Jan
(1) |
Feb
(7) |
Mar
|
Apr
(2) |
May
|
Jun
(1) |
Jul
(2) |
Aug
(20) |
Sep
|
Oct
|
Nov
|
Dec
(7) |
2008 |
Jan
(4) |
Feb
(13) |
Mar
(24) |
Apr
(18) |
May
(10) |
Jun
|
Jul
|
Aug
(40) |
Sep
(72) |
Oct
(61) |
Nov
(9) |
Dec
(2) |
2009 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
(8) |
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
(41) |
Aug
(28) |
Sep
(2) |
Oct
(5) |
Nov
(4) |
Dec
|
2011 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Patrick C. <pa...@us...> - 2003-03-13 18:22:30
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv17290 Modified Files: interfaces-bpf.cc Log Message: Fix some inconsistencies. latd & moprc now run on NetBSD ! Index: interfaces-bpf.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces-bpf.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** interfaces-bpf.cc 12 Mar 2003 17:12:22 -0000 1.3 --- interfaces-bpf.cc 13 Mar 2003 18:22:25 -0000 1.4 *************** *** 372,376 **** memcpy(ether_packet.ether_dhost, macaddr, ETHER_ADDR_LEN); memcpy(ether_packet.ether_shost, _latd_bpf_interface_addr, ETHER_ADDR_LEN); ! ether_packet.ether_type = htons(ETHERTYPE_LAT); /* write this packet: */ --- 372,376 ---- memcpy(ether_packet.ether_dhost, macaddr, ETHER_ADDR_LEN); memcpy(ether_packet.ether_shost, _latd_bpf_interface_addr, ETHER_ADDR_LEN); ! ether_packet.ether_type = htons(protocol); /* write this packet: */ *************** *** 621,625 **** struct ifreq interface_ifreq; struct bpf_program program; - int dummy_fd; /* if we don't have an interface, bail: */ --- 621,624 ---- *************** *** 640,644 **** /* set the filter on the BPF device: */ program.bf_len = sizeof(moprc_bpf_filter) / sizeof(moprc_bpf_filter[0]); ! program.bf_insns = lat_bpf_filter; if (ioctl(_latd_bpf_fd, BIOCSETF, &program) < 0) { debuglog(("bpf: failed to set the filter: %s\n", strerror(errno))); --- 639,643 ---- /* set the filter on the BPF device: */ program.bf_len = sizeof(moprc_bpf_filter) / sizeof(moprc_bpf_filter[0]); ! program.bf_insns = moprc_bpf_filter; if (ioctl(_latd_bpf_fd, BIOCSETF, &program) < 0) { debuglog(("bpf: failed to set the filter: %s\n", strerror(errno))); *************** *** 664,668 **** } ! // These are just flag values ! int LATinterfaces::ProtoLAT = 1; ! int LATinterfaces::ProtoMOP = 2; --- 663,666 ---- } ! int LATinterfaces::ProtoLAT = ETHERTYPE_LAT; ! int LATinterfaces::ProtoMOP = ETHERTYPE_MOPRC; |
From: Patrick C. <pa...@us...> - 2003-03-12 17:12:42
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv4452 Modified Files: dn_endian.h interfaces.h interfaces-bpf.cc interfaces-linux.cc interfaces.cc latcp.cc llogin.cc llogincircuit.cc localport.cc moprc.cc server.cc serversession.cc services.cc Log Message: More *BSD porting. It mostly works on NetBSD now. I'm making a start on porting it to Darwin too, 'cos that's of most use to me :-) Index: dn_endian.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/dn_endian.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** dn_endian.h 10 Feb 2001 12:22:49 -0000 1.2 --- dn_endian.h 12 Mar 2003 17:12:21 -0000 1.3 *************** *** 21,24 **** --- 21,29 ---- #endif + #ifdef __APPLE__ + #include <architecture/byte_order.h> + #define __BYTE_ORDER BYTE_ORDER + #endif + #ifndef __BYTE_ORDER Index: interfaces.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** interfaces.h 15 Feb 2003 12:59:13 -0000 1.4 --- interfaces.h 12 Mar 2003 17:12:21 -0000 1.5 *************** *** 76,77 **** --- 76,87 ---- static int ProtoMOP; }; + + // Make sure we have the packet types + #ifndef ETHERTYPE_LAT + #define ETHERTYPE_LAT 0x6004 + #endif + + #ifndef ETHERTYPE_MOPRC + #define ETHERTYPE_MOPRC 0x6002 + #endif + Index: interfaces-bpf.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces-bpf.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** interfaces-bpf.cc 21 Feb 2003 15:18:54 -0000 1.2 --- interfaces-bpf.cc 12 Mar 2003 17:12:22 -0000 1.3 *************** *** 183,187 **** std::string BPFInterfaces::ifname(int ifn) { ! string str; if (ifn == 0 && _latd_bpf_interface_name != NULL) { --- 183,187 ---- std::string BPFInterfaces::ifname(int ifn) { ! std::string str; if (ifn == 0 && _latd_bpf_interface_name != NULL) { *************** *** 241,244 **** --- 241,245 ---- for(ifr_offset = 0;; ifr_offset += SIZEOF_IFREQ(ifr)) { + /* stop walking if we have run out of space in the buffer. note that before we can use SIZEOF_IFREQ, we have to make sure that *************** *** 374,378 **** /* write this packet: */ ! iov[0].iov_base = ðer_packet; iov[0].iov_len = sizeof(ether_packet); iov[1].iov_base = data; --- 375,379 ---- /* write this packet: */ ! iov[0].iov_base = (char* )ðer_packet; iov[0].iov_len = sizeof(ether_packet); iov[1].iov_base = data; *************** *** 406,409 **** --- 407,411 ---- _latd_bpf_buffer_size); if (buffer_end <= 0) { + if (errno == EAGAIN) return 0; debuglog(("bpf: failed to read packets: %s\n", strerror(errno))); return (-1); *************** *** 661,662 **** --- 663,668 ---- return 0; } + + // These are just flag values + int LATinterfaces::ProtoLAT = 1; + int LATinterfaces::ProtoMOP = 2; Index: interfaces-linux.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces-linux.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** interfaces-linux.cc 16 Feb 2003 18:07:09 -0000 1.5 --- interfaces-linux.cc 12 Mar 2003 17:12:22 -0000 1.6 *************** *** 143,147 **** } ! // Find an interface number by name int LinuxInterfaces::find_interface(char *name) { --- 143,148 ---- } ! // Find an interface number by name, or ! // use the first one if name is NULL. int LinuxInterfaces::find_interface(char *name) { *************** *** 150,153 **** --- 151,157 ---- int sock = socket(PF_PACKET, SOCK_RAW, 0); + // Default "1st" interface + if (!name) name = "eth0"; + ifr.ifr_ifindex = iindex; *************** *** 213,216 **** --- 217,221 ---- int len; + memset(&msg, 0, sizeof(msg)); msg.msg_name = &sock_info; msg.msg_namelen = sizeof(sock_info); Index: interfaces.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** interfaces.cc 21 Feb 2003 15:18:54 -0000 1.4 --- interfaces.cc 12 Mar 2003 17:12:23 -0000 1.5 *************** *** 16,24 **** #include "interfaces.h" - #ifdef __linux__ - #include "interfaces-linux.h" - #endif - - LATinterfaces::LATinterfaces() { --- 16,19 ---- Index: latcp.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcp.cc,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -r1.36 -r1.37 *** latcp.cc 21 Feb 2003 15:18:54 -0000 1.36 --- latcp.cc 12 Mar 2003 17:12:23 -0000 1.37 *************** *** 802,807 **** exit(2); } - #else - #error OK, a bit more porting work needed here too. #endif sprintf(latcp_env, "LATCP=%s", latcp_bin); --- 802,805 ---- *************** *** 929,933 **** struct sockaddr_un sockaddr; ! latcp_socket = socket(AF_UNIX, SOCK_STREAM, PF_UNIX); if (latcp_socket == -1) { --- 927,931 ---- struct sockaddr_un sockaddr; ! latcp_socket = socket(PF_UNIX, SOCK_STREAM, 0); if (latcp_socket == -1) { Index: llogin.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogin.cc,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** llogin.cc 10 Sep 2002 12:21:26 -0000 1.17 --- llogin.cc 12 Mar 2003 17:12:24 -0000 1.18 *************** *** 39,43 **** --- 39,45 ---- #include <assert.h> #include <termios.h> + #ifdef DEVICE_LOCKING #include <lockdev.h> + #endif #include <list> *************** *** 71,75 **** --- 73,79 ---- printf (" -d -v show learned services verbosely\n"); printf (" -p connect to a local device rather than a service\n"); + #ifdef DEVICE_LOCKING printf (" -L Don't do device locking when using -p\n"); + #endif printf (" -H <node> remote node name\n"); printf (" -R <port> remote port name\n"); *************** *** 300,304 **** struct sockaddr_un sockaddr; ! latcp_socket = socket(AF_UNIX, SOCK_STREAM, PF_UNIX); if (latcp_socket == -1) { --- 304,308 ---- struct sockaddr_un sockaddr; ! latcp_socket = socket(PF_UNIX, SOCK_STREAM, 0); if (latcp_socket == -1) { *************** *** 441,444 **** --- 445,449 ---- struct termios new_term; + #ifdef DEVICE_LOCKING if (!nolock) { *************** *** 449,452 **** --- 454,458 ---- } } + #endif termfd = open(portname, O_RDWR); *************** *** 454,458 **** --- 460,466 ---- { fprintf(stderr, "Cannot open device %s: %s\n", portname, strerror(errno)); + #ifdef DEVICE_LOCKING dev_unlock(portname, getpid()); + #endif return -1; } *************** *** 479,483 **** --- 487,493 ---- close(termfd); + #ifdef DEVICE_LOCKING if (!nolock) dev_unlock(portname, getpid()); + #endif return 0; } Index: llogincircuit.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogincircuit.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** llogincircuit.cc 3 Jan 2002 09:45:17 -0000 1.7 --- llogincircuit.cc 12 Mar 2003 17:12:26 -0000 1.8 *************** *** 16,19 **** --- 16,20 ---- #include <unistd.h> #include <syslog.h> + #include <time.h> #include <strstream> Index: localport.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/localport.cc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** localport.cc 3 Apr 2002 15:40:30 -0000 1.8 --- localport.cc 12 Mar 2003 17:12:26 -0000 1.9 *************** *** 92,96 **** --- 92,98 ---- tio.c_iflag |= IGNBRK|BRKINT; tio.c_oflag &= ~ONLCR; + #ifdef OCRNL tio.c_oflag &= ~OCRNL; + #endif tio.c_iflag &= ~INLCR; tio.c_iflag &= ~ICRNL; Index: moprc.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/moprc.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** moprc.cc 21 Feb 2003 15:18:54 -0000 1.2 --- moprc.cc 12 Mar 2003 17:12:27 -0000 1.3 *************** *** 63,67 **** fprintf(f, " -h Show this usage message\n"); fprintf(f, " -V Show the version of moprc\n"); ! fprintf(f, " -i Ethernet interface to use (default eth0)\n"); fprintf(f, " -t Trigger (reboot) the server\n"); fprintf(f, " -v Show target information\n"); --- 63,67 ---- fprintf(f, " -h Show this usage message\n"); fprintf(f, " -V Show the version of moprc\n"); ! fprintf(f, " -i Ethernet interface to use (default to first found)\n"); fprintf(f, " -t Trigger (reboot) the server\n"); fprintf(f, " -v Show target information\n"); *************** *** 80,86 **** static int send_message(unsigned char *buf, int len, int interface, u_int8_t *macaddr) { if (len < 46) len = 46; ! return iface->send_packet(interface, macaddr, buf, len); } --- 80,90 ---- static int send_message(unsigned char *buf, int len, int interface, u_int8_t *macaddr) { + int status; if (len < 46) len = 46; ! status = iface->send_packet(interface, macaddr, buf, len); ! if (status < 0) ! perror("send message"); ! return status; } *************** *** 95,100 **** int interface = -1; int trigger=0; ! char *env; ! char ifname[255]; struct ether_addr addr; --- 99,104 ---- int interface = -1; int trigger=0; ! char ifname_buf[255]; ! char *ifname; struct ether_addr addr; *************** *** 105,117 **** /* Look for MOPRC_INTERFACE environment variable */ ! env = getenv("MOPRC_INTERFACE"); ! if (env) ! { ! strcpy(ifname, env); ! } ! else ! { ! strcpy(ifname, "eth0"); ! } /* Get command-line options */ --- 109,113 ---- /* Look for MOPRC_INTERFACE environment variable */ ! ifname = getenv("MOPRC_INTERFACE"); /* Get command-line options */ *************** *** 136,140 **** case 'i': ! strcpy(ifname, optarg); break; --- 132,137 ---- case 'i': ! strcpy(ifname_buf, optarg); ! ifname = ifname_buf; break; *************** *** 181,189 **** if (interface == -1) { ! fprintf(stderr, "Cannot resolve interface %s\n", ifname); return 2; } ! mop_socket = iface->get_fd(0); if (iface->bind_socket(interface)) return 3; --- 178,189 ---- if (interface == -1) { ! if (ifname) ! fprintf(stderr, "Cannot resolve interface %s\n", ifname); ! else ! fprintf(stderr, "Cannot find any ethernet interfaces\n"); return 2; } ! mop_socket = iface->get_fd(interface); if (iface->bind_socket(interface)) return 3; Index: server.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.cc,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -r1.64 -r1.65 *** server.cc 15 Feb 2003 12:59:13 -0000 1.64 --- server.cc 12 Mar 2003 17:12:27 -0000 1.65 *************** *** 14,18 **** #include <sys/types.h> #include <sys/uio.h> - #include <sys/socket.h> #include <sys/un.h> #include <sys/ioctl.h> --- 14,17 ---- *************** *** 20,24 **** --- 19,27 ---- #include <sys/stat.h> #include <sys/time.h> + #include <sys/socket.h> #include <sys/utsname.h> + #ifdef HAVE_NET_ETHERNET_H + #include <net/ethernet.h> + #endif #include <stdio.h> #include <errno.h> *************** *** 60,63 **** --- 63,70 ---- #include "dn_endian.h" + #ifdef __APPLE__ + typedef int socklen_t; + #endif + // Remove any dangling symlinks in the /dev/lat directory void LATServer::tidy_dev_directory() *************** *** 281,284 **** --- 288,292 ---- if (iface->send_packet(interface_num[i], addr, packet, ptr) < 0) { + debuglog(("sending service announcement, send error: %d\n", errno)); interface_error(interface_num[i], errno); } Index: serversession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/serversession.cc,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** serversession.cc 25 Dec 2002 11:45:38 -0000 1.15 --- serversession.cc 12 Mar 2003 17:12:29 -0000 1.16 *************** *** 14,17 **** --- 14,18 ---- #include <sys/types.h> + #include <sys/time.h> #include <sys/resource.h> #include <stdio.h> Index: services.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/services.cc,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** services.cc 14 Oct 2002 14:45:14 -0000 1.12 --- services.cc 12 Mar 2003 17:12:30 -0000 1.13 *************** *** 14,18 **** #include <stdio.h> ! #include <sys/time.h> #include <netinet/in.h> #include <list> --- 14,18 ---- #include <stdio.h> ! #include <time.h> #include <netinet/in.h> #include <list> |
From: Patrick C. <pa...@us...> - 2003-02-21 15:20:13
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv31798 Added Files: Makefile.bsd Log Message: Makefile for *BSD systems. Only tested on NetBSD. Yes, I know fredette used autoconf. tough. --- NEW FILE: Makefile.bsd --- # Makefile for LAT server VERSION=1.17 PKGNAME=latd PROG1=latd PROG2=latcp PROG3=llogin PROG4=moprc MANPAGES1=llogin.1 MANPAGES5=latd.conf.5 MANPAGES8=latd.8 latcp.8 moprc.8 PROG1OBJS=main.o utils.o server.o connection.o session.o \ serversession.o clientsession.o queuedsession.o services.o \ latcpcircuit.o lat_messages.o lloginsession.o llogincircuit.o \ circuit.o localport.o localportsession.o interfaces.o interfaces-bpf.o PROG2OBJS=latcp.o utils.o PROG3OBJS=llogin.o utils.o PROG4OBJS=moprc.o interfaces.o interfaces-bpf.o DEFS=-DVERSION=\"$(VERSION)\" -DLATCP_SOCKNAME=\"$(LATCPSOCK)\" -DLLOGIN_SOCKNAME=\"$(LLOGINSOCK)\" DEFS+=-DUSE_OPENPTY -DHAVE_NET_IF_ETHER_H -DHAVE_NET_IF_DL_H # These are debugging options, know what you are doing before setting these. #DEFS+=-DVERBOSE_DEBUG -DNO_FORK -DDEBUG_MALLOC -DHAVE_MCHECK_H #DEFS+=-DREALLY_VERBOSE_DEBUGLOG #DEFS+=-DPACKET_LOSS=8 prefix=/usr/local LATCPSOCK="/var/run/latcp" LLOGINSOCK="/var/run/latlogin" OPTDEBUG=-g CXX=c++ CXXFLAGS+=$(OPTDEBUG) $(DEFS) -pipe -Wstrict-prototypes -Wall -fno-rtti -fno-exceptions # # Targets: # all: $(PROG1) $(PROG2) $(PROG3) $(PROG4) $(PROG1): depend $(PROG1OBJS) $(CXX) -o $@ $(PROG1OBJS) -lutil $(PROG2): depend $(PROG2OBJS) $(CXX) -o $@ $(PROG2OBJS) $(PROG3): depend $(PROG3OBJS) $(CXX) -o $@ $(PROG3OBJS) -llockdev $(PROG4): depend $(PROG4OBJS) $(CXX) $(CFLAGS) -o $@ $(PROG4OBJS) install: install -d $(prefix)/sbin install -d $(prefix)/bin install -d $(prefix)/man/man1 install -d $(prefix)/man/man5 install -d $(prefix)/man/man8 install -m 0750 -s $(PROG1) $(prefix)/sbin install -m 0750 -s $(PROG2) $(prefix)/sbin install -m 0755 -s $(PROG3) $(prefix)/bin install -m 0750 -s $(PROG4) $(prefix)/sbin install -m 0644 $(MANPAGES1) $(prefix)/man/man1 install -m 0644 $(MANPAGES5) $(prefix)/man/man5 install -m 0644 $(MANPAGES8) $(prefix)/man/man8 dep depend: #$(CXX) $(CXXFLAGS) -MM *.cc >.depend 2>/dev/null clean: rm -f .depend rm -f $(PROG1) $(PROG2) $(PROG3) $(PROG4) *.o *.bak .depend core rm -rf debian/tmp dist: rm -f .depend rm -rf debian/tmp cd ..; tar czf latd-$(VERSION).tar.gz latd/*.h latd/*.cc latd/*.c \ latd/BUGS latd/README latd/NEWS latd/Makefile latd/rpm.spec \ latd/WARRANTY latd/COPYING latd/INSTALL latd/TODO \ latd/*.[1-8] latd/latd.conf latd/startlat.sh \ |
From: Patrick C. <pa...@us...> - 2003-02-21 15:18:58
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv30837 Modified Files: circuit.cc interfaces-bpf.cc interfaces-bpf.h interfaces.cc latcp.cc latcpcircuit.cc localportsession.cc main.cc moprc.cc utils.h Log Message: A bit BSD tidying and porting. It probably still doesn't work yet but I'm not going to get the chance to to any more work on it for a couple of weeks so I might as well get this into CVS. Index: circuit.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/circuit.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** circuit.cc 3 Jan 2002 08:46:55 -0000 1.2 --- circuit.cc 21 Feb 2003 15:18:54 -0000 1.3 *************** *** 1,4 **** /****************************************************************************** ! (c) 2001 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2001-2003 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 14,17 **** --- 14,18 ---- #include <sys/types.h> + #include <sys/time.h> #include <unistd.h> Index: interfaces-bpf.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces-bpf.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** interfaces-bpf.cc 16 Feb 2003 18:12:41 -0000 1.1 --- interfaces-bpf.cc 21 Feb 2003 15:18:54 -0000 1.2 *************** *** 86,90 **** }; ! int BPFInterfaces::Start() { #define DEV_BPF_FORMAT "/dev/bpf%d" --- 86,90 ---- }; ! int BPFInterfaces::Start(int proto) { #define DEV_BPF_FORMAT "/dev/bpf%d" *************** *** 95,98 **** --- 95,100 ---- struct bpf_version version; + protocol = proto; + /* loop trying to open a /dev/bpf device: */ for(minor = 0;; minor++) { *************** *** 613,619 **** } ! int BPFInterfaces::bind_socket(int interface) { ! // TODO: ! return -1; } --- 615,662 ---- } ! int BPFInterfaces::bind_socket(int ifn) { ! struct ifreq interface_ifreq; ! struct bpf_program program; ! int dummy_fd; ! ! /* if we don't have an interface, bail: */ ! if (ifn != 0 || _latd_bpf_interface_name == NULL) { ! syslog(LOG_ERR, "No interfaces\n"); ! return -1; ! } ! strcpy(interface_ifreq.ifr_name, _latd_bpf_interface_name); ! ! /* point the BPF device at the interface we're using: */ ! if (ioctl(_latd_bpf_fd, BIOCSETIF, &interface_ifreq) < 0) { ! debuglog(("bpf: failed to point BPF socket at %s: %s\n", ! interface_ifreq.ifr_name, strerror(errno))); ! syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); ! return -1; ! } ! ! /* set the filter on the BPF device: */ ! program.bf_len = sizeof(moprc_bpf_filter) / sizeof(moprc_bpf_filter[0]); ! program.bf_insns = lat_bpf_filter; ! if (ioctl(_latd_bpf_fd, BIOCSETF, &program) < 0) { ! debuglog(("bpf: failed to set the filter: %s\n", strerror(errno))); ! syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); ! return -1; ! } ! ! /* get the BPF read buffer size: */ ! if (ioctl(_latd_bpf_fd, BIOCGBLEN, &_latd_bpf_buffer_size) < 0) { ! debuglog(("bpf: failed to read the buffer size: %s\n", strerror(errno))); ! syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); ! return -1; ! } ! debuglog(("bpf: buffer size is %u\n", _latd_bpf_buffer_size)); ! ! /* allocate the buffer for BPF reads: */ ! if ((_latd_bpf_buffer = (unsigned char *) malloc(_latd_bpf_buffer_size)) == NULL) { ! abort(); ! } ! _latd_bpf_buffer_end = _latd_bpf_buffer_offset = 0; ! ! return 0; } Index: interfaces-bpf.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces-bpf.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** interfaces-bpf.h 16 Feb 2003 18:12:41 -0000 1.1 --- interfaces-bpf.h 21 Feb 2003 15:18:54 -0000 1.2 *************** *** 23,27 **** // Initialise ! virtual int Start(); // Return a list of valid interface numbers and the count --- 23,27 ---- // Initialise ! virtual int Start(int proto); // Return a list of valid interface numbers and the count Index: interfaces.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** interfaces.cc 16 Feb 2003 18:07:09 -0000 1.3 --- interfaces.cc 21 Feb 2003 15:18:54 -0000 1.4 *************** *** 29,32 **** } ! // LATinterfaces *LATinterfaces::Create() is in // a real implementation class. --- 29,32 ---- } ! // LATinterfaces::Create() is in // a real implementation class. Index: latcp.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcp.cc,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -r1.35 -r1.36 *** latcp.cc 7 Jun 2002 13:16:48 -0000 1.35 --- latcp.cc 21 Feb 2003 15:18:54 -0000 1.36 *************** *** 535,542 **** struct passwd *target_user; - opterr = 0; - optind = 0; - while ((opt=getopt(argc,argv,"a:i:p:H:R:V:r:w:sQ8C:m:u:")) != EOF) { --- 535,539 ---- Index: latcpcircuit.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcpcircuit.cc,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** latcpcircuit.cc 13 Feb 2002 09:40:21 -0000 1.20 --- latcpcircuit.cc 21 Feb 2003 15:18:54 -0000 1.21 *************** *** 1,4 **** /****************************************************************************** ! (c) 2000 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2000-2003 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 14,17 **** --- 14,18 ---- #include <sys/types.h> + #include <sys/time.h> #include <unistd.h> *************** *** 52,60 **** debuglog(("latcp: do_command on fd %d\n", fd)); ! // Get the message header (cmd & length) if (read(fd, head, sizeof(head)) != 3) return false; // Bad header ! int len = head[1] * 256 + head[2]; unsigned char *cmdbuf = new unsigned char[len]; --- 53,61 ---- debuglog(("latcp: do_command on fd %d\n", fd)); ! // Get the message header (cmd & length) if (read(fd, head, sizeof(head)) != 3) return false; // Bad header ! int len = head[1] * 256 + head[2]; unsigned char *cmdbuf = new unsigned char[len]; *************** *** 67,71 **** } ! // Have we completed negotiation? if (head[0] != LATCP_VERSION && state != RUNNING) --- 68,72 ---- } ! // Have we completed negotiation? if (head[0] != LATCP_VERSION && state != RUNNING) *************** *** 74,80 **** return false; } ! debuglog(("latcp: do_command %d\n", head[0])); ! // Do the command switch (head[0]) --- 75,81 ---- return false; } ! debuglog(("latcp: do_command %d\n", head[0])); ! // Do the command switch (head[0]) *************** *** 118,122 **** break; ! case LATCP_SETRESPONDER: { --- 119,123 ---- break; ! case LATCP_SETRESPONDER: { *************** *** 125,129 **** } break; ! case LATCP_UNLOCK: { --- 126,130 ---- } break; ! case LATCP_UNLOCK: { *************** *** 181,185 **** break; ! // Change the rating of a service case LATCP_SETRATING: --- 182,186 ---- break; ! // Change the rating of a service case LATCP_SETRATING: *************** *** 219,223 **** ! // Add a login service case LATCP_ADDSERVICE: --- 220,224 ---- ! // Add a login service case LATCP_ADDSERVICE: *************** *** 246,250 **** if (LATServer::Instance()->add_service((char*)name, (char*)ident, (char*)command, ! max_connections, target_uid, target_gid, rating, static_rating)) send_reply(LATCP_ACK, "", -1); --- 247,251 ---- if (LATServer::Instance()->add_service((char*)name, (char*)ident, (char*)command, ! max_connections, target_uid, target_gid, rating, static_rating)) send_reply(LATCP_ACK, "", -1); *************** *** 253,257 **** } break; ! // Delete service case LATCP_REMSERVICE: --- 254,258 ---- } break; ! // Delete service case LATCP_REMSERVICE: *************** *** 355,360 **** // MSC DVK 12-Feb-2002, more verbose error report to user. // ! ! res = LATServer::Instance()->create_local_port(service, remport, localport, --- 356,361 ---- // MSC DVK 12-Feb-2002, more verbose error report to user. // ! ! res = LATServer::Instance()->create_local_port(service, remport, localport, Index: localportsession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/localportsession.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** localportsession.cc 7 Feb 2003 17:16:50 -0000 1.4 --- localportsession.cc 21 Feb 2003 15:18:54 -0000 1.5 *************** *** 15,18 **** --- 15,22 ---- #include <sys/types.h> #include <sys/stat.h> + #include <sys/ioctl.h> + #ifdef HAVE_SYS_FILIO_H + #include <sys/filio.h> + #endif #include <stdio.h> #include <syslog.h> Index: main.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/main.cc,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** main.cc 31 Mar 2002 12:00:10 -0000 1.19 --- main.cc 21 Feb 2003 15:18:54 -0000 1.20 *************** *** 12,16 **** --- 12,18 ---- GNU General Public License for more details. ******************************************************************************/ + #ifdef HAVE_MCHECK_H #include <mcheck.h> + #endif #include <sys/types.h> #include <sys/uio.h> Index: moprc.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/moprc.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** moprc.cc 15 Feb 2003 12:59:13 -0000 1.1 --- moprc.cc 21 Feb 2003 15:18:54 -0000 1.2 *************** *** 36,40 **** --- 36,45 ---- #include <signal.h> #include <assert.h> + #ifdef HAVE_NET_IF_ETHER_H + #include <net/if.h> + #include <net/if_ether.h> + #else #include <netinet/ether.h> + #endif #include <string> *************** *** 112,116 **** /* Get command-line options */ opterr = 0; - optind = 0; while ((opt=getopt(argc,argv,"?hVvti:")) != EOF) { --- 117,120 ---- *************** *** 180,183 **** --- 184,188 ---- return 2; } + mop_socket = iface->get_fd(0); if (iface->bind_socket(interface)) Index: utils.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/utils.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** utils.h 23 Oct 2002 07:37:19 -0000 1.6 --- utils.h 21 Feb 2003 15:18:54 -0000 1.7 *************** *** 25,32 **** const char *servicename); ! #ifndef USE_OPENPTY #define INTERNAL_OPENPTY #else #include <pty.h> #endif --- 25,43 ---- const char *servicename); ! #ifndef HAVE_OPENPTY #define INTERNAL_OPENPTY #else + #ifdef HAVE_PTY_H #include <pty.h> + #endif /* HAVE_PTY_H */ + #ifdef HAVE_TERMIOS_H + #include <termios.h> + #endif /* HAVE_TERMIOS_H */ + #ifdef HAVE_LIBUTIL_H + #include <libutil.h> + #endif /* HAVE_LIBUTIL_H */ + #ifdef HAVE_UTIL_H + #include <util.h> + #endif /* HAVE_UTIL_H */ #endif |
From: Patrick C. <pa...@us...> - 2003-02-16 18:12:44
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv6056 Added Files: interfaces-bpf.cc interfaces-bpf.h Log Message: Import Matthew Fredette's BPF interface files. They don't compile yet (plenty of MOP work needed) --- NEW FILE: interfaces-bpf.cc --- /****************************************************************************** (c) 2002 Matthew Fredette fre...@ne... 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 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. ******************************************************************************/ #include <unistd.h> #include <stdio.h> #include <fcntl.h> #include <errno.h> #include <syslog.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/time.h> #include <sys/socket.h> #include <sys/uio.h> #include <net/if.h> #include <net/bpf.h> #ifdef HAVE_NET_IF_ETHER_H #include <net/if_ether.h> #endif /* HAVE_NET_IF_ETHER_H */ #ifdef HAVE_NET_ETHERNET_H #include <net/ethernet.h> #endif /* HAVE_NET_ETHERNET_H */ #ifdef HAVE_NET_IF_DL_H #include <net/if_dl.h> #endif #include <netinet/in.h> #include <string> #include "utils.h" #define _LATD_INTERFACES_IMPL #include "interfaces.h" #include "interfaces-bpf.h" LATinterfaces *LATinterfaces::Create() { return new BPFInterfaces(); } /* this macro helps us size a struct ifreq: */ #ifdef HAVE_SOCKADDR_SA_LEN #define SIZEOF_IFREQ(ifr) (sizeof(ifr->ifr_name) + ifr->ifr_addr.sa_len) #else /* !HAVE_SOCKADDR_SA_LEN */ #define SIZEOF_IFREQ(ifr) (sizeof(ifr->ifr_name) + sizeof(struct sockaddr)) #endif /* !HAVE_SOCKADDR_SA_LEN */ #define LATD_OFFSETOF(t, m) (((char *) &(((t *) NULL)-> m)) - ((char *) ((t *) NULL))) /* the BPF program to capture LAT packets: */ static struct bpf_insn lat_bpf_filter[] = { /* drop this packet if its ethertype isn't ETHERTYPE_LAT: */ BPF_STMT(BPF_LD + BPF_H + BPF_ABS, LATD_OFFSETOF(struct ether_header, ether_type)), BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, ETHERTYPE_LAT, 0, 1), /* accept this packet: */ BPF_STMT(BPF_RET + BPF_K, (u_int) -1), /* drop this packet: */ BPF_STMT(BPF_RET + BPF_K, 0), }; /* the BPF program to capture MOP RC packets: */ static struct bpf_insn moprc_bpf_filter[] = { /* drop this packet if its ethertype isn't ETHERTYPE_MOPRC: */ BPF_STMT(BPF_LD + BPF_H + BPF_ABS, LATD_OFFSETOF(struct ether_header, ether_type)), BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, ETHERTYPE_MOPRC, 0, 1), /* accept this packet: */ BPF_STMT(BPF_RET + BPF_K, (u_int) -1), /* drop this packet: */ BPF_STMT(BPF_RET + BPF_K, 0), }; int BPFInterfaces::Start() { #define DEV_BPF_FORMAT "/dev/bpf%d" char dev_bpf_filename[sizeof(DEV_BPF_FORMAT) + (sizeof(int) * 3) + 1]; int minor; int saved_errno; u_int bpf_opt; struct bpf_version version; /* loop trying to open a /dev/bpf device: */ for(minor = 0;; minor++) { /* form the name of the next device to try, then try opening it. if we succeed, we're done: */ sprintf(dev_bpf_filename, DEV_BPF_FORMAT, minor); debuglog(("bpf: trying %s\n", dev_bpf_filename)); if ((_latd_bpf_fd = open(dev_bpf_filename, O_RDWR)) >= 0) { debuglog(("bpf: opened %s\n", dev_bpf_filename)); break; } /* we failed to open this device. if this device was simply busy, loop: */ debuglog(("bpf: failed to open %s: %s\n", dev_bpf_filename, strerror(errno))); if (errno == EBUSY) { continue; } /* otherwise, we have failed: */ syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); return -1; } /* this macro helps in closing the BPF socket on error: */ #define _LATD_RAW_OPEN_ERROR(x) saved_errno = errno; x; errno = saved_errno /* check the BPF version: */ if (ioctl(_latd_bpf_fd, BIOCVERSION, &version) < 0) { debuglog(("bpf: failed to get the BPF version on %s: %s\n", dev_bpf_filename, strerror(errno))); _LATD_RAW_OPEN_ERROR(close(_latd_bpf_fd)); syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); return -1; } if (version.bv_major != BPF_MAJOR_VERSION || version.bv_minor < BPF_MINOR_VERSION) { debuglog(("bpf: kernel BPF version is %d.%d, my BPF version is %d.%d\n", version.bv_major, version.bv_minor, BPF_MAJOR_VERSION, BPF_MINOR_VERSION)); close(_latd_bpf_fd); errno = ENXIO; syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); return -1; } /* put the BPF device into immediate mode: */ bpf_opt = true; if (ioctl(_latd_bpf_fd, BIOCIMMEDIATE, &bpf_opt) < 0) { debuglog(("bpf: failed to put %s into immediate mode: %s\n", dev_bpf_filename, strerror(errno))); _LATD_RAW_OPEN_ERROR(close(_latd_bpf_fd)); syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); return -1; } /* tell the BPF device we're providing complete Ethernet headers: */ bpf_opt = true; if (ioctl(_latd_bpf_fd, BIOCSHDRCMPLT, &bpf_opt) < 0) { debuglog(("bpf: failed to put %s into complete-headers mode: %s\n", dev_bpf_filename, strerror(errno))); _LATD_RAW_OPEN_ERROR(close(_latd_bpf_fd)); syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); return -1; } /* done: */ return 0; #undef _LATD_RAW_OPEN_ERROR } // Return a list of valid interface numbers and the count void BPFInterfaces::get_all_interfaces(int *ifs, int &num) { num = 0; if (find_interface(NULL) == 0) { ifs[num++] = 0; } } // Print the name of an interface std::string BPFInterfaces::ifname(int ifn) { string str; if (ifn == 0 && _latd_bpf_interface_name != NULL) { str.append(_latd_bpf_interface_name); str.append(" "); } return str; } // Find an interface number by name int BPFInterfaces::find_interface(char *ifname) { int saved_errno; int dummy_fd; char ifreq_buffer[16384]; /* FIXME - magic constant. */ struct ifconf ifc; struct ifreq *ifr; struct ifreq *ifr_user; size_t ifr_offset; struct sockaddr_in saved_ip_address; short saved_flags; #ifdef HAVE_AF_LINK struct ifreq *link_ifreqs[20]; /* FIXME - magic constant. */ size_t link_ifreqs_count; size_t link_ifreqs_i; struct sockaddr_dl *sadl; #endif /* HAVE_AF_LINK */ /* if we have already chosen an interface, ignore this one: */ if (_latd_bpf_interface_name != NULL) { return (-1); } /* make a dummy socket so we can read the interface list: */ if ((dummy_fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { return (-1); } /* read the interface list: */ ifc.ifc_len = sizeof(ifreq_buffer); ifc.ifc_buf = ifreq_buffer; if (ioctl(dummy_fd, SIOCGIFCONF, &ifc) < 0) { saved_errno = errno; close(dummy_fd); errno = saved_errno; return (-1); } #ifdef HAVE_AF_LINK /* start our list of link address ifreqs: */ link_ifreqs_count = 0; #endif /* HAVE_AF_LINK */ /* walk the interface list: */ ifr_user = NULL; for(ifr_offset = 0;; ifr_offset += SIZEOF_IFREQ(ifr)) { /* stop walking if we have run out of space in the buffer. note that before we can use SIZEOF_IFREQ, we have to make sure that there is a minimum number of bytes in the buffer to use it (namely, that there's a whole struct sockaddr available): */ ifr = (struct ifreq *) (ifreq_buffer + ifr_offset); if ((ifr_offset + sizeof(ifr->ifr_name) + sizeof(struct sockaddr)) > (size_t)ifc.ifc_len || (ifr_offset + SIZEOF_IFREQ(ifr)) > (size_t)ifc.ifc_len) { errno = ENOENT; break; } #ifdef HAVE_AF_LINK /* if this is a hardware address, save it: */ if (ifr->ifr_addr.sa_family == AF_LINK) { if (link_ifreqs_count < (sizeof(link_ifreqs) / sizeof(link_ifreqs[0]))) { link_ifreqs[link_ifreqs_count++] = ifr; } continue; } #endif /* HAVE_AF_LINK */ /* ignore this interface if it doesn't do IP: */ if (ifr->ifr_addr.sa_family != AF_INET) { continue; } /* get the interface flags, preserving the IP address in the struct ifreq across the call: */ saved_ip_address = *((struct sockaddr_in *) &ifr->ifr_addr); if (ioctl(dummy_fd, SIOCGIFFLAGS, ifr) < 0) { ifr = NULL; break; } saved_flags = ifr->ifr_flags; *((struct sockaddr_in *) &ifr->ifr_addr) = saved_ip_address; /* ignore this interface if it isn't up and running: */ if ((saved_flags & (IFF_UP | IFF_RUNNING)) != (IFF_UP | IFF_RUNNING)) { continue; } /* if we don't have an interface yet, take this one depending on whether the user asked for an interface by name or not. if he did, and this is it, take this one. if he didn't, and this isn't a loopback interface, take this one: */ if (ifr_user == NULL && (ifname != NULL ? !strncmp(ifr->ifr_name, ifname, sizeof(ifr->ifr_name)) : !(ifr->ifr_flags & IFF_LOOPBACK))) { ifr_user = ifr; } } /* close the dummy socket: */ saved_errno = errno; close(dummy_fd); errno = saved_errno; /* if we don't have an interface to return: */ if (ifr_user == NULL) { return (-1); } #ifdef HAVE_AF_LINK /* we must be able to find an AF_LINK ifreq that gives us the interface's Ethernet address. */ ifr = NULL; for(link_ifreqs_i = 0; link_ifreqs_i < link_ifreqs_count; link_ifreqs_i++) { if (!strncmp(link_ifreqs[link_ifreqs_i]->ifr_name, ifr_user->ifr_name, sizeof(ifr_user->ifr_name))) { ifr = link_ifreqs[link_ifreqs_i]; break; } } if (ifr == NULL) { return (-1); } /* copy out the Ethernet address: */ sadl = (struct sockaddr_dl *) &ifr->ifr_addr; memcpy(_latd_bpf_interface_addr, LLADDR(sadl), sadl->sdl_alen); #else /* !HAVE_AF_LINK */ #error "must have AF_LINK for now" #endif /* !HAVE_AF_LINK */ /* remember this single interface name: */ if ((_latd_bpf_interface_name = strdup(ifr_user->ifr_name)) == NULL) { abort(); } /* this zero is a fake interface index: */ debuglog(("bpf: interface Ethernet address is %02x:%02x:%02x:%02x:%02x:%02x\n", _latd_bpf_interface_addr[0], _latd_bpf_interface_addr[1], _latd_bpf_interface_addr[2], _latd_bpf_interface_addr[3], _latd_bpf_interface_addr[4], _latd_bpf_interface_addr[5])); return (0); } // true if this class defines one FD for each active // interface, false if one fd is used for all interfaces. bool BPFInterfaces::one_fd_per_interface() { return false; } // Return the FD for this interface (will only be called once for // select if above returns false) int BPFInterfaces::get_fd(int ifn) { return _latd_bpf_fd; } // Send a packet to a given macaddr int BPFInterfaces::send_packet(int ifn, unsigned char macaddr[], unsigned char *data, int len) { struct ether_header ether_packet; struct iovec iov[2]; /* we only support one interface: */ assert(ifn == 0); /* make the Ethernet header: */ memcpy(ether_packet.ether_dhost, macaddr, ETHER_ADDR_LEN); memcpy(ether_packet.ether_shost, _latd_bpf_interface_addr, ETHER_ADDR_LEN); ether_packet.ether_type = htons(ETHERTYPE_LAT); /* write this packet: */ iov[0].iov_base = ðer_packet; iov[0].iov_len = sizeof(ether_packet); iov[1].iov_base = data; iov[1].iov_len = len; if (writev(_latd_bpf_fd, iov, 2) < 0) { syslog(LOG_ERR, "writev: %m"); return -1; } return 0; } // Receive a packet from a given interface int BPFInterfaces::recv_packet(int sockfd, int &ifn, unsigned char macaddr[], unsigned char *data, int maxlen) { ssize_t buffer_end; struct bpf_hdr the_bpf_header; unsigned int _latd_bpf_buffer_offset_next; /* loop until we have something to return: */ for(;;) { /* if the buffer is empty, fill it: */ if (_latd_bpf_buffer_offset >= _latd_bpf_buffer_end) { /* read the BPF socket: */ debuglog(("bpf: calling read\n")); buffer_end = read(sockfd, _latd_bpf_buffer, _latd_bpf_buffer_size); if (buffer_end <= 0) { debuglog(("bpf: failed to read packets: %s\n", strerror(errno))); return (-1); } debuglog(("bpf: read %d bytes of packets\n", buffer_end)); _latd_bpf_buffer_offset = 0; _latd_bpf_buffer_end = buffer_end; } /* if there's not enough for a BPF header, flush the buffer: */ if ((_latd_bpf_buffer_offset + sizeof(the_bpf_header)) > _latd_bpf_buffer_end) { debuglog(("bpf: flushed garbage BPF header bytes\n")); _latd_bpf_buffer_end = 0; continue; } /* get the BPF header and check it: */ memcpy(&the_bpf_header, _latd_bpf_buffer + _latd_bpf_buffer_offset, sizeof(the_bpf_header)); _latd_bpf_buffer_offset_next = _latd_bpf_buffer_offset + BPF_WORDALIGN(the_bpf_header.bh_hdrlen + the_bpf_header.bh_caplen); _latd_bpf_buffer_offset += the_bpf_header.bh_hdrlen; /* if we're missing some part of the packet: */ if (the_bpf_header.bh_caplen != the_bpf_header.bh_datalen || ((_latd_bpf_buffer_offset + the_bpf_header.bh_datalen) > _latd_bpf_buffer_end)) { debuglog(("bpf: flushed truncated BPF packet (caplen %d, datalen %d, offset %d, end %d\n", the_bpf_header.bh_caplen, the_bpf_header.bh_datalen, _latd_bpf_buffer_offset, _latd_bpf_buffer_end)); _latd_bpf_buffer_offset = _latd_bpf_buffer_offset_next; continue; } /* silently ignore packets that don't even have Ethernet headers, and those packets that we transmitted: */ if (the_bpf_header.bh_datalen < sizeof(struct ether_header) || !memcmp(((struct ether_header *) (_latd_bpf_buffer + _latd_bpf_buffer_offset))->ether_shost, _latd_bpf_interface_addr, ETHER_ADDR_LEN)) { /* silently ignore packets from us: */ _latd_bpf_buffer_offset = _latd_bpf_buffer_offset_next; continue; } debuglog(("bpf: packet from %02x:%02x:%02x:%02x:%02x:%02x\n", ((struct ether_header *) (_latd_bpf_buffer + _latd_bpf_buffer_offset))->ether_shost[0], ((struct ether_header *) (_latd_bpf_buffer + _latd_bpf_buffer_offset))->ether_shost[1], ((struct ether_header *) (_latd_bpf_buffer + _latd_bpf_buffer_offset))->ether_shost[2], ((struct ether_header *) (_latd_bpf_buffer + _latd_bpf_buffer_offset))->ether_shost[3], ((struct ether_header *) (_latd_bpf_buffer + _latd_bpf_buffer_offset))->ether_shost[4], ((struct ether_header *) (_latd_bpf_buffer + _latd_bpf_buffer_offset))->ether_shost[5])); /* if the caller hasn't provided a large enough buffer: */ if (maxlen < 0 || (unsigned int)maxlen < the_bpf_header.bh_datalen) { errno = EIO; _latd_bpf_buffer_offset = _latd_bpf_buffer_offset_next; return (-1); } /* return this captured packet to the user. the caller doesn't want the Ethernet header as part of the packet, but he does want the source address. */ memcpy(data, _latd_bpf_buffer + _latd_bpf_buffer_offset + sizeof(struct ether_header), the_bpf_header.bh_datalen - sizeof(struct ether_header)); ifn = 0; memcpy(macaddr, ((struct ether_header *) (_latd_bpf_buffer + _latd_bpf_buffer_offset))->ether_shost, ETHER_ADDR_LEN); _latd_bpf_buffer_offset = _latd_bpf_buffer_offset_next; return (the_bpf_header.bh_datalen - sizeof(struct ether_header)); } /* NOTREACHED */ } // Open a connection on an interface int BPFInterfaces::set_lat_multicast(int ifn) { struct ifreq interface_ifreq; struct bpf_program program; int dummy_fd; /* if we don't have an interface, bail: */ if (ifn != 0 || _latd_bpf_interface_name == NULL) { syslog(LOG_ERR, "No interfaces\n"); return -1; } strcpy(interface_ifreq.ifr_name, _latd_bpf_interface_name); /* point the BPF device at the interface we're using: */ if (ioctl(_latd_bpf_fd, BIOCSETIF, &interface_ifreq) < 0) { debuglog(("bpf: failed to point BPF socket at %s: %s\n", interface_ifreq.ifr_name, strerror(errno))); syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); return -1; } /* set the filter on the BPF device: */ program.bf_len = sizeof(lat_bpf_filter) / sizeof(lat_bpf_filter[0]); program.bf_insns = lat_bpf_filter; if (ioctl(_latd_bpf_fd, BIOCSETF, &program) < 0) { debuglog(("bpf: failed to set the filter: %s\n", strerror(errno))); syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); return -1; } /* get the BPF read buffer size: */ if (ioctl(_latd_bpf_fd, BIOCGBLEN, &_latd_bpf_buffer_size) < 0) { debuglog(("bpf: failed to read the buffer size: %s\n", strerror(errno))); syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); return -1; } debuglog(("bpf: buffer size is %u\n", _latd_bpf_buffer_size)); /* allocate the buffer for BPF reads: */ if ((_latd_bpf_buffer = (unsigned char *) malloc(_latd_bpf_buffer_size)) == NULL) { abort(); } _latd_bpf_buffer_end = _latd_bpf_buffer_offset = 0; // Add Multicast membership for LAT on socket /* make a dummy socket so we can manipulate an interface: */ if ((dummy_fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { syslog(LOG_ERR, "Can't create a dummy socket: %m\n"); return -1; } /* This is the LAT multicast address */ interface_ifreq.ifr_addr.sa_family = AF_UNSPEC; #ifdef HAVE_SOCKADDR_SA_LEN interface_ifreq.ifr_addr.sa_len = sizeof(interface_ifreq.ifr_addr); #endif /* HAVE_SOCKADDR_SA_LEN */ ((unsigned char *) interface_ifreq.ifr_addr.sa_data)[0] = 0x09; ((unsigned char *) interface_ifreq.ifr_addr.sa_data)[1] = 0x00; ((unsigned char *) interface_ifreq.ifr_addr.sa_data)[2] = 0x2b; ((unsigned char *) interface_ifreq.ifr_addr.sa_data)[3] = 0x00; ((unsigned char *) interface_ifreq.ifr_addr.sa_data)[4] = 0x00; ((unsigned char *) interface_ifreq.ifr_addr.sa_data)[5] = 0x0f; if (ioctl(dummy_fd, SIOCADDMULTI, &interface_ifreq) < 0) { debuglog(("bpf: failed to add to the multicast list for interface for %s: %s\n", interface_ifreq.ifr_name, strerror(errno))); syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); close(dummy_fd); return -1; } /* close the dummy socket: */ close(dummy_fd); return 0; } // Close an interface. int BPFInterfaces::remove_lat_multicast(int ifn) { struct ifreq interface_ifreq; int dummy_fd; /* if we don't have an interface, bail: */ if (ifn != 0 || _latd_bpf_interface_name == NULL) { syslog(LOG_ERR, "No interfaces\n"); return -1; } strcpy(interface_ifreq.ifr_name, _latd_bpf_interface_name); // Delete Multicast membership for LAT on socket /* make a dummy socket so we can manipulate an interface: */ if ((dummy_fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { syslog(LOG_ERR, "Can't create a dummy socket: %m\n"); return -1; } /* This is the LAT multicast address */ interface_ifreq.ifr_addr.sa_family = AF_UNSPEC; #ifdef HAVE_SOCKADDR_SA_LEN interface_ifreq.ifr_addr.sa_len = sizeof(interface_ifreq.ifr_addr); #endif /* HAVE_SOCKADDR_SA_LEN */ ((unsigned char *) interface_ifreq.ifr_addr.sa_data)[0] = 0x09; ((unsigned char *) interface_ifreq.ifr_addr.sa_data)[1] = 0x00; ((unsigned char *) interface_ifreq.ifr_addr.sa_data)[2] = 0x2b; ((unsigned char *) interface_ifreq.ifr_addr.sa_data)[3] = 0x00; ((unsigned char *) interface_ifreq.ifr_addr.sa_data)[4] = 0x00; ((unsigned char *) interface_ifreq.ifr_addr.sa_data)[5] = 0x0f; if (ioctl(dummy_fd, SIOCDELMULTI, &interface_ifreq) < 0) { debuglog(("bpf: failed to delete from the multicast list for interface for %s: %s\n", interface_ifreq.ifr_name, strerror(errno))); syslog(LOG_ERR, "can't remove socket multicast: %m\n"); close(dummy_fd); return -1; } /* close the dummy socket: */ close(dummy_fd); return 0; } int BPFInterfaces::bind_socket(int interface) { // TODO: return -1; } --- NEW FILE: interfaces-bpf.h --- /****************************************************************************** (c) 2002 Patrick Caulfield pa...@de... 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 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. ******************************************************************************/ #define HAVE_AF_LINK // interfaces-bpf.h // BPF implementation of LATinterfaces class BPFInterfaces : public LATinterfaces { public: BPFInterfaces() { _latd_bpf_interface_name = NULL; }; ~BPFInterfaces() {}; // Initialise virtual int Start(); // Return a list of valid interface numbers and the count virtual void get_all_interfaces(int *ifs, int &num); // Print the name of an interface virtual std::string ifname(int ifn); // Find an interface number by name virtual int find_interface(char *name); // true if this class defines one FD for each active // interface, false if one fd is used for all interfaces. virtual bool one_fd_per_interface(); // Return the FD for this interface (will only be called once for // select if above returns false) virtual int get_fd(int ifn); // Send a packet to a given macaddr virtual int send_packet(int ifn, unsigned char macaddr[], unsigned char *data, int len); // Receive a packet from a given interface virtual int recv_packet(int sockfd, int &ifn, unsigned char macaddr[], unsigned char *data, int maxlen); // Open a connection on an interface virtual int set_lat_multicast(int ifn); // Close an interface. virtual int remove_lat_multicast(int ifn); // Bind a socket to an interface virtual int bind_socket(int interface); /* these are bad, but they get the job done for now. we only support using a single interface: */ int _latd_bpf_fd; char *_latd_bpf_interface_name; unsigned char _latd_bpf_interface_addr[ETHER_ADDR_LEN]; unsigned int _latd_bpf_buffer_size; unsigned char *_latd_bpf_buffer; unsigned int _latd_bpf_buffer_end; unsigned int _latd_bpf_buffer_offset; private: }; |
From: Patrick C. <pa...@us...> - 2003-02-16 18:07:13
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv3805 Modified Files: interfaces-linux.cc interfaces.cc Log Message: Move LATinterfaces::Create() to interfaces-linux.cc where we really know how instantiate it. Index: interfaces-linux.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces-linux.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** interfaces-linux.cc 15 Feb 2003 12:59:13 -0000 1.4 --- interfaces-linux.cc 16 Feb 2003 18:07:09 -0000 1.5 *************** *** 293,294 **** --- 293,299 ---- } + // Here's where we know how to instantiate the class. + LATinterfaces *LATinterfaces::Create() + { + return new LinuxInterfaces(); + } Index: interfaces.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** interfaces.cc 8 Feb 2002 15:24:18 -0000 1.2 --- interfaces.cc 16 Feb 2003 18:07:09 -0000 1.3 *************** *** 29,39 **** } ! ! LATinterfaces *LATinterfaces::Create() ! { ! #ifdef __linux__ ! return new LinuxInterfaces(); ! #endif ! ! // TODO Stick others here... ! } --- 29,32 ---- } ! // LATinterfaces *LATinterfaces::Create() is in ! // a real implementation class. |
From: Patrick C. <pa...@us...> - 2003-02-15 13:00:28
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv16338 Modified Files: Makefile Log Message: Bits for new moprc Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/latd/Makefile,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -r1.36 -r1.37 *** Makefile 10 Jan 2003 12:06:16 -0000 1.36 --- Makefile 15 Feb 2003 13:00:20 -0000 1.37 *************** *** 1,5 **** # Makefile for LAT server ! VERSION=1.16 PKGNAME=latd --- 1,5 ---- # Makefile for LAT server ! VERSION=1.17 PKGNAME=latd *************** *** 18,22 **** PROG2OBJS=latcp.o utils.o PROG3OBJS=llogin.o utils.o ! PROG4OBJS=moprc.o DEFS=-DVERSION=\"$(VERSION)\" -DLATCP_SOCKNAME=\"$(LATCPSOCK)\" -DLLOGIN_SOCKNAME=\"$(LLOGINSOCK)\" --- 18,22 ---- PROG2OBJS=latcp.o utils.o PROG3OBJS=llogin.o utils.o ! PROG4OBJS=moprc.o interfaces.o interfaces-linux.o DEFS=-DVERSION=\"$(VERSION)\" -DLATCP_SOCKNAME=\"$(LATCPSOCK)\" -DLLOGIN_SOCKNAME=\"$(LLOGINSOCK)\" *************** *** 68,72 **** $(PROG4): depend $(PROG4OBJS) ! $(CC) $(CFLAGS) -o $@ $(PROG4OBJS) install: --- 68,72 ---- $(PROG4): depend $(PROG4OBJS) ! $(CXX) $(CFLAGS) -o $@ $(PROG4OBJS) install: *************** *** 85,89 **** dep depend: ! @$(CXX) -MM *.cc >.depend 2>/dev/null clean: --- 85,89 ---- dep depend: ! @$(CXX) $(CXXFLAGS) -MM *.cc >.depend 2>/dev/null clean: |
From: Patrick C. <pa...@us...> - 2003-02-15 12:59:18
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv15483 Modified Files: interfaces-linux.h interfaces.h interfaces-linux.cc server.cc Added Files: moprc.cc Log Message: moprc now uses the interface functions of the LATinterfaces class. The next step is to incorporate Matthew Fredette's BPF interfaces class... --- NEW FILE: moprc.cc --- /****************************************************************************** (c) 2001-2003 patrick Caulfield pa...@de... 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 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. ******************************************************************************/ #include <sys/types.h> #include <sys/uio.h> #include <sys/socket.h> #include <sys/un.h> #include <sys/ioctl.h> #include <sys/wait.h> #include <sys/stat.h> #include <sys/time.h> #include <sys/utsname.h> #include <stdio.h> #include <errno.h> #include <unistd.h> #include <termios.h> #include <signal.h> #include <string.h> #include <fcntl.h> #include <dirent.h> #include <ctype.h> #include <regex.h> #include <stdlib.h> #include <utmp.h> #include <grp.h> #include <signal.h> #include <assert.h> #include <netinet/ether.h> #include <string> #include "interfaces.h" #include "moprc.h" static int mop_socket; static unsigned char last_message[1500]; static int last_message_len; static int show_info = 0; static int do_moprc(u_int8_t *, int); static int send_boot(u_int8_t *macaddr, int interface); static LATinterfaces *iface; static int usage(FILE *f, char *cmd) { fprintf(f, "\nUsage: %s [?hVv] [-i <interface>] <node name>|<macaddr>\n", cmd); fprintf(f, " -? Show this usage message\n"); fprintf(f, " -h Show this usage message\n"); fprintf(f, " -V Show the version of moprc\n"); fprintf(f, " -i Ethernet interface to use (default eth0)\n"); fprintf(f, " -t Trigger (reboot) the server\n"); fprintf(f, " -v Show target information\n"); fprintf(f, "\n"); fprintf(f, "Node names are read from /etc/ethers\n"); fprintf(f, "MAC addresses in colon-seperated form. eg:\n"); fprintf(f, "\n%s -i eth1 08:00:2B:2B:AD:99\n", cmd); if (geteuid() != 0) fprintf(f, "\nYou will probably need to be root to run this program.\n"); fprintf(f, "\n"); return -1; } /* Send a MOP message to a specified MAC address */ static int send_message(unsigned char *buf, int len, int interface, u_int8_t *macaddr) { if (len < 46) len = 46; return iface->send_packet(interface, macaddr, buf, len); } static int send_last_message(int interface, u_int8_t *macaddr) { return send_message(last_message, last_message_len, interface, macaddr); } int main(int argc, char *argv[]) { int opt; int interface = -1; int trigger=0; char *env; char ifname[255]; struct ether_addr addr; if (argc < 2) { return usage(stdout, argv[0]); } /* Look for MOPRC_INTERFACE environment variable */ env = getenv("MOPRC_INTERFACE"); if (env) { strcpy(ifname, env); } else { strcpy(ifname, "eth0"); } /* Get command-line options */ opterr = 0; optind = 0; while ((opt=getopt(argc,argv,"?hVvti:")) != EOF) { switch(opt) { case 'h': return usage(stdout, argv[0]); case '?': return usage(stdout, argv[0]); case 'v': show_info++; break; case 't': trigger++; break; case 'i': strcpy(ifname, optarg); break; case 'V': printf("\nMoprc version %s\n\n", VERSION); exit(0); break; } } if (!argv[optind]) { return usage(stderr, argv[0]); } /* Check for a hostname in /etc/ethers */ if (ether_hostton(argv[optind], &addr) != 0) { struct ether_addr *addr1; /* Otherwise parse ethernet MAC address */ addr1 = ether_aton(argv[optind]); if (addr1) { addr = *addr1; } else { fprintf(stderr, "unknown node name or bad MAC address %s\n", argv[optind]); return 3; } } /* Initialise the platform-specific interface code */ iface = LATinterfaces::Create(); if (iface->Start(LATinterfaces::ProtoMOP) == -1) { fprintf(stderr, "Can't create MOP protocol socket: %s\n", strerror(errno)); exit(1); } // If no interface on the command-line then use defaults interface = iface->find_interface(ifname); if (interface == -1) { fprintf(stderr, "Cannot resolve interface %s\n", ifname); return 2; } mop_socket = iface->get_fd(0); if (iface->bind_socket(interface)) return 3; if (trigger) { return send_boot(addr.ether_addr_octet, interface); } return do_moprc(addr.ether_addr_octet, interface); } static int readmop(unsigned char *buf, int buflen) { int ifn; unsigned char macaddr[6]; return iface->recv_packet(mop_socket, ifn, macaddr, buf, buflen); } static int send_reserve(u_int8_t *macaddr, int interface) { unsigned char buf[32]; memset(buf, 0, sizeof(buf)); buf[0] = 9; buf[1] = 0; buf[2] = MOPRC_CMD_RESERVE; return send_message(buf, 11, interface, macaddr); } static int send_release(u_int8_t *macaddr, int interface) { unsigned char buf[32]; memset(buf, 0, sizeof(buf)); buf[0] = 1; buf[1] = 0; buf[2] = MOPRC_CMD_RELEASE; return send_message(buf, 3, interface, macaddr); } static int send_reqid(u_int8_t *macaddr, int interface) { unsigned char buf[32]; memset(buf, 0, sizeof(buf)); buf[0] = 4; buf[1] = 0; buf[2] = MOPRC_CMD_REQUESTID; return send_message(buf, 7, interface, macaddr); } static int send_boot(u_int8_t *macaddr, int interface) { unsigned char buf[32]; memset(buf, 0, sizeof(buf)); buf[0] = 12; buf[1] = 0; buf[2] = MOPRC_CMD_BOOT; buf[13] = 0xFF; return send_message(buf, 14, interface, macaddr); } static int send_data(unsigned char *data, int len, u_int8_t *macaddr, int interface) { unsigned char buf[len+46]; static char message = 0; memset(buf, 0, sizeof(buf)); buf[0] = len+2; buf[1] = 0; buf[2] = MOPRC_CMD_COMMANDPOLL; buf[3] = message; memcpy(buf+4, data, len); message = 1-message; return send_message(buf, len+4, interface, macaddr); } static void print_ascic(unsigned char *buf, int len) { int i; for (i=0; i <len; i++) { if (isprint(buf[i])) printf("%c", buf[i]); else printf("."); } printf("\n"); } static int show_system_info(unsigned char *info, int len) { int index=0; int functions = 0; while (index < len) { int type = info[index] | info[index+1]<<8; int infolen = info[index+2]; index += 3; if (show_info || type == 2) { switch (type) { case 1: /* Maintenance version */ printf("Maintenance Version: %d.%d.%d\n", info[index],info[index+1],info[index+2]); break; case 2: /* Functions */ functions = info[index]; break; /* These are sent by terminal servers */ case 102: printf("ROM version: "); print_ascic(&info[index], infolen); break; case 103: printf("S/W version: "); print_ascic(&info[index], infolen); break; case 105: printf("Node Name: "); print_ascic(&info[index], infolen); break; case 106: printf("Identification: "); print_ascic(&info[index], infolen); break; /* Other stuff */ case 201: printf("Operating System: "); print_ascic(&info[index], infolen); break; case 202: printf("Software Version: "); print_ascic(&info[index], infolen); break; case 203: printf("Node Name: "); print_ascic(&info[index], infolen); break; default: break; } index += infolen; } } if (show_info) printf("\n"); return functions & 0x20; /* Do we do CCP? */ } static int do_moprc(u_int8_t *macaddr, int interface) { enum {STARTING, CONNECTED} state=STARTING; fd_set in; unsigned char buf[1500]; struct timeval tv; struct termios old_term; struct termios new_term; int len; int last_msg_tag = 99; /* Dummy */ int status; int timeout = 200000; /* Poll interval */ int waiting_ack; int resends = 0; int termfd = STDIN_FILENO; tcgetattr(termfd, &old_term); new_term = old_term; /* Set local terminal characteristics */ new_term.c_iflag &= ~BRKINT; new_term.c_iflag |= IGNBRK | INLCR; new_term.c_lflag &= ~ISIG; new_term.c_cc[VMIN] = 1; new_term.c_cc[VTIME] = 0; new_term.c_lflag &= ~ICANON; new_term.c_lflag &= ~(ECHO | ECHOCTL | ECHONL); tcsetattr(termfd, TCSANOW, &new_term); /* Send connect packets */ send_reserve(macaddr, interface); send_reqid(macaddr, interface); waiting_ack = 1; /* Main loop */ FD_ZERO(&in); FD_SET(mop_socket, &in); tv.tv_sec = 5; tv.tv_usec = 0; /* Loop for input */ while ( (status = select(FD_SETSIZE, &in, NULL, NULL, &tv)) >= 0) { /* No data, poll for any input from the terminal server */ if (status == 0 && !waiting_ack) { unsigned char dummybuf[1]; send_data(dummybuf, 0, macaddr, interface); waiting_ack = 1; resends = 0; } /* Waiting for an ACK but not got one. Resend the last packet */ if (status == 0 && waiting_ack) { send_last_message(interface, macaddr); if (++resends == 3) { printf("\nTarget does not respond\n"); break; } } /* Data from the terminal server */ if (FD_ISSET(mop_socket, &in)) { int cmd; int datalen; len = readmop(buf, sizeof(buf)); if (len < 0) { perror("reading from Remote"); return -1; } if (len == 0) continue; waiting_ack = 0; cmd = buf[2]; datalen = buf[0] | buf[1] <<8; /* Ignore duplicates */ if (last_msg_tag == buf[3]) continue; last_msg_tag = buf[3]; switch (cmd) { case MOPRC_CMD_RESERVE: case MOPRC_CMD_RELEASE: case MOPRC_CMD_REQUESTID: fprintf(stderr, "Got unsupported MOPRC function %d\n", cmd); break; /* Got some data to display */ case MOPRC_CMD_RESPONSE: if (datalen >= 2) { int i; for (i=0; i<datalen-2; i++) { fputc(buf[4+i], stdout); } fflush(stdout); } break; /* Response to our REQUESTID message means we are connected */ case MOPRC_CMD_SYSTEMID: if (state == STARTING) { if (show_system_info(&buf[6], datalen-1) == 0) { printf("target does not support remote console\n"); goto finished; } if (isatty(STDIN_FILENO)) printf("Console connected (press CTRL/D when finished)\n"); state = CONNECTED; } break; default: fprintf(stderr, "Got unknown MOPRC function %d\n", cmd); break; } } /* Keyboard input */ if (FD_ISSET(STDIN_FILENO, &in)) { int i; len = read(STDIN_FILENO, buf, sizeof(buf)); if (len < 0) { perror("reading from stdin"); return -1; } if (len == 0) break; /* Convert LF to CR & check for ^D */ for (i=0; i<len; i++) { if (buf[i] == 4) goto finished; if (buf[i] == '\n') buf[i] = '\r'; } waiting_ack = 1; resends = 0; send_data(buf, len, macaddr, interface); } /* Reset for another select */ tv.tv_usec = timeout; tv.tv_sec = 0; FD_ZERO(&in); FD_SET(mop_socket, &in); if (!waiting_ack) FD_SET(STDIN_FILENO, &in); } finished: /* Send disconnect */ send_release(macaddr, interface); tcsetattr(termfd, TCSANOW, &old_term); printf("\n"); return 0; } Index: interfaces-linux.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces-linux.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** interfaces-linux.h 8 Feb 2002 15:06:52 -0000 1.1 --- interfaces-linux.h 15 Feb 2003 12:59:13 -0000 1.2 *************** *** 23,27 **** // Initialise ! virtual int Start(); // Return a list of valid interface numbers and the count --- 23,27 ---- // Initialise ! virtual int Start(int proto); // Return a list of valid interface numbers and the count *************** *** 48,56 **** virtual int recv_packet(int sockfd, int &ifn, unsigned char macaddr[], unsigned char *data, int maxlen); ! // Open a connection on an interface ! virtual int open_connection(int ifn); ! // Close an interface. ! virtual int close_connection(int ifn); private: --- 48,59 ---- virtual int recv_packet(int sockfd, int &ifn, unsigned char macaddr[], unsigned char *data, int maxlen); ! // Enable reception of LAT multicast messages ! virtual int set_lat_multicast(int ifn); ! // Finished listening for LAT multicasts ! virtual int remove_lat_multicast(int ifn); ! ! // Bind a socket to an interface ! virtual int bind_socket(int interface); private: Index: interfaces.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** interfaces.h 7 Feb 2003 17:16:51 -0000 1.3 --- interfaces.h 15 Feb 2003 12:59:13 -0000 1.4 *************** *** 24,27 **** --- 24,32 ---- class LATinterfaces { + protected: + + // Save a copy of the protocol + int protocol; + public: *************** *** 30,34 **** // Initialise the LAT protocol ! virtual int Start()=0; // Return a list of valid interface numbers and the count --- 35,39 ---- // Initialise the LAT protocol ! virtual int Start(int proto)=0; // Return a list of valid interface numbers and the count *************** *** 55,65 **** virtual int recv_packet(int fd, int &ifn, unsigned char macaddr[], unsigned char *data, int maxlen)=0; ! // Open a connection on an interface ! virtual int open_connection(int ifn)=0; ! // Close an interface. ! virtual int close_connection(int ifn)=0; // Creates a platform-specifc interfaces class static LATinterfaces *Create(); }; --- 60,77 ---- virtual int recv_packet(int fd, int &ifn, unsigned char macaddr[], unsigned char *data, int maxlen)=0; ! // Enable reception of LAT multicast messages ! virtual int set_lat_multicast(int ifn)=0; ! // Finished listening for LAT multicasts ! virtual int remove_lat_multicast(int ifn)=0; ! ! // Bind a socket to an interface ! virtual int bind_socket(int interface)=0; // Creates a platform-specifc interfaces class static LATinterfaces *Create(); + + // Protocols we can Start() + static int ProtoLAT; + static int ProtoMOP; }; Index: interfaces-linux.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces-linux.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** interfaces-linux.cc 26 Aug 2002 08:32:11 -0000 1.3 --- interfaces-linux.cc 15 Feb 2003 12:59:13 -0000 1.4 *************** *** 1,4 **** /****************************************************************************** ! (c) 2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2002-2003 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 64,75 **** #include "interfaces-linux.h" ! int LinuxInterfaces::Start() { ! // Open LAT protocol socket ! fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_LAT)); if (fd < 0) { ! syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); return -1; } --- 64,79 ---- #include "interfaces-linux.h" + int LATinterfaces::ProtoLAT = ETH_P_LAT; + int LATinterfaces::ProtoMOP = ETH_P_DNA_RC; ! int LinuxInterfaces::Start(int proto) { ! protocol = proto; ! ! // Open raw socket on specified protocol ! fd = socket(PF_PACKET, SOCK_DGRAM, htons(protocol)); if (fd < 0) { ! syslog(LOG_ERR, "Can't create protocol socket: %m\n"); return -1; } *************** *** 122,125 **** --- 126,146 ---- } + // Bind a socket to an interface + int LinuxInterfaces::bind_socket(int interface) + { + struct sockaddr_ll sock_info; + + sock_info.sll_family = AF_PACKET; + sock_info.sll_protocol = htons(protocol); + + sock_info.sll_ifindex = interface; + if (bind(fd, (struct sockaddr *)&sock_info, sizeof(sock_info))) + { + perror("can't bind socket to i/f %m\n"); + return -1; + } + return 0; + } + // Find an interface number by name int LinuxInterfaces::find_interface(char *name) *************** *** 173,177 **** /* Build the sockaddr_ll structure */ sock_info.sll_family = AF_PACKET; ! sock_info.sll_protocol = htons(ETH_P_LAT); sock_info.sll_ifindex = ifn; sock_info.sll_hatype = 0;//ARPHRD_ETHER; --- 194,198 ---- /* Build the sockaddr_ll structure */ sock_info.sll_family = AF_PACKET; ! sock_info.sll_protocol = htons(protocol); sock_info.sll_ifindex = ifn; sock_info.sll_hatype = 0;//ARPHRD_ETHER; *************** *** 214,218 **** // Open a connection on an interface ! int LinuxInterfaces::open_connection(int ifn) { // Add Multicast membership for LAT on socket --- 235,240 ---- // Open a connection on an interface ! // Only necessary for LAT sockets. ! int LinuxInterfaces::set_lat_multicast(int ifn) { // Add Multicast membership for LAT on socket *************** *** 244,248 **** // Close an interface. ! int LinuxInterfaces::close_connection(int ifn) { // Add Multicast membership for LAT on socket --- 266,270 ---- // Close an interface. ! int LinuxInterfaces::remove_lat_multicast(int ifn) { // Add Multicast membership for LAT on socket Index: server.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.cc,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -r1.63 -r1.64 *** server.cc 10 Jan 2003 09:01:04 -0000 1.63 --- server.cc 15 Feb 2003 12:59:13 -0000 1.64 *************** *** 345,349 **** for (int i=0; i<num_interfaces;i++) { ! iface->open_connection(interface_num[i]); } --- 345,349 ---- for (int i=0; i<num_interfaces;i++) { ! iface->set_lat_multicast(interface_num[i]); } *************** *** 878,882 **** /* Initialise the platform-specific interface code */ iface = LATinterfaces::Create(); ! if (iface->Start() == -1) { syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); --- 878,882 ---- /* Initialise the platform-specific interface code */ iface = LATinterfaces::Create(); ! if (iface->Start(LATinterfaces::ProtoLAT) == -1) { syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); |
From: Patrick C. <pa...@us...> - 2003-02-07 19:27:08
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv9216 Modified Files: lat.html README Log Message: Minor doc updates. including the regular company name change. Index: lat.html =================================================================== RCS file: /cvsroot/linux-decnet/latd/lat.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** lat.html 3 Apr 2002 13:40:46 -0000 1.4 --- lat.html 7 Feb 2003 19:27:03 -0000 1.5 *************** *** 39,43 **** </p> ! <p>The latcp commands are based on those used in Compaq Tru64 Unix, so if you are familiar with that then this should all look very familiar to you. However, they are <i>not</i> identical to Tru64 so you should still at least --- 39,43 ---- </p> ! <p>The latcp commands are based on those used in HP Tru64 Unix, so if you are familiar with that then this should all look very familiar to you. However, they are <i>not</i> identical to Tru64 so you should still at least *************** *** 361,365 **** <hr width="100%"><br> ! <i>Compaq</i> and <i>Tru64 Unix</i> are trademarks of Compaq Computers Inc and <i>DECserver</i> probably is too.<br> <br> --- 361,365 ---- <hr width="100%"><br> ! <i>HP</i> and <i>Tru64 Unix</i> are trademarks of HP Inc and <i>DECserver</i> probably is too.<br> <br> Index: README =================================================================== RCS file: /cvsroot/linux-decnet/latd/README,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** README 21 Dec 2002 12:18:25 -0000 1.10 --- README 7 Feb 2003 19:27:03 -0000 1.11 *************** *** 31,38 **** This code is a clean-room reverse-engineering effort. I have no access to ! Compaq technical documentation or source code for LAT and nor do I want any. This software should work on all Linux architectures. I have tested it on ! Intel, Alpha, SPARC, MIPS and PowerPC. See the file lat.html for information on using LAT on Linux. --- 31,38 ---- This code is a clean-room reverse-engineering effort. I have no access to ! HP technical documentation or source code for LAT and nor do I want any. This software should work on all Linux architectures. I have tested it on ! Intel, Alpha, SPARC, MIPS, PA-RISC and PowerPC. See the file lat.html for information on using LAT on Linux. *************** *** 49,53 **** OpenVMS 7.2 (VAX & Alpha) DEC Unix v4.0d ! DECserver 200 DECserver 90M DECserver 90L+ --- 49,53 ---- OpenVMS 7.2 (VAX & Alpha) DEC Unix v4.0d ! DECserver 200/MC DECserver 90M DECserver 90L+ *************** *** 62,67 **** I am also very much indebted to Real Dupeux for sending me a DECserver 200 for the project, without which it would be much impoverished. I use it a for ! reverse-LAT every day of the week to log in to the consoles of my VAX, Alpha, ! SPARC and MIPS machines. I would also like to express gratitude to ABB for providing a DECserver 90M and --- 62,67 ---- I am also very much indebted to Real Dupeux for sending me a DECserver 200 for the project, without which it would be much impoverished. I use it a for ! reverse-LAT every day of the week to log in to the consoles of my various ! machines. I would also like to express gratitude to ABB for providing a DECserver 90M and |
From: Patrick C. <pa...@us...> - 2003-02-07 17:16:57
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv5457 Modified Files: connection.cc localportsession.cc interfaces.h localportsession.h Log Message: Don't show status messages to /dev/lat ports Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -r1.52 -r1.53 *** connection.cc 7 Feb 2003 17:03:37 -0000 1.52 --- connection.cc 7 Feb 2003 17:16:49 -0000 1.53 *************** *** 1,4 **** /****************************************************************************** ! (c) 2000-2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2000-2003 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 1137,1141 **** int newsessionnum = next_session_number(); ! lloginSession *newsession = new localportSession(*this, lport, 0, newsessionnum, (char *)localport, fd); if (newsession->new_session((unsigned char *)remnode, (char *)service, (char *)port, (char *)password, 0) == -1) --- 1137,1141 ---- int newsessionnum = next_session_number(); ! localportSession *newsession = new localportSession(*this, lport, 0, newsessionnum, (char *)localport, fd); if (newsession->new_session((unsigned char *)remnode, (char *)service, (char *)port, (char *)password, 0) == -1) Index: localportsession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/localportsession.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** localportsession.cc 11 Feb 2002 16:39:34 -0000 1.3 --- localportsession.cc 7 Feb 2003 17:16:50 -0000 1.4 *************** *** 1,4 **** /****************************************************************************** ! (c) 2001 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2001-2003 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 87,88 **** --- 87,94 ---- } } + + void localportSession::show_status(unsigned char *node, LAT_StatusEntry *entry) + { + // Dont show status. + } + Index: interfaces.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** interfaces.h 8 Feb 2002 15:24:18 -0000 1.2 --- interfaces.h 7 Feb 2003 17:16:51 -0000 1.3 *************** *** 1,4 **** /****************************************************************************** ! (c) 2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2002-2003 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify Index: localportsession.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/localportsession.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** localportsession.h 11 Feb 2002 14:09:38 -0000 1.3 --- localportsession.h 7 Feb 2003 17:16:51 -0000 1.4 *************** *** 1,4 **** /****************************************************************************** ! (c) 2001-2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2001-2003 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 21,24 **** --- 21,25 ---- virtual ~localportSession(); virtual void do_read(); + virtual void show_status(unsigned char *node, LAT_StatusEntry *entry); |
From: Patrick C. <pa...@us...> - 2003-02-07 17:03:43
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv30326 Modified Files: connection.cc Log Message: Clear the master's last_msg_sent flag when we get a queued connect or things go VERY wrong. Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -r1.51 -r1.52 *** connection.cc 7 Jan 2003 10:57:24 -0000 1.51 --- connection.cc 7 Feb 2003 17:03:37 -0000 1.52 *************** *** 313,316 **** --- 313,317 ---- { last_msg_type = 0; + (*master_conn)->last_msg_type = 0; // Connect a new port session to it *************** *** 693,697 **** { last_msg_time = tt; - switch (last_msg_type) { --- 694,697 ---- |
From: Patrick C. <pa...@us...> - 2003-01-12 16:17:12
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv23014 Modified Files: moprc.8 moprc.c Log Message: Add support for MOPRC_INTERFACE environment variable to override default of eth0 Index: moprc.8 =================================================================== RCS file: /cvsroot/linux-decnet/latd/moprc.8,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** moprc.8 3 Jan 2002 08:46:55 -0000 1.2 --- moprc.8 12 Jan 2003 16:17:09 -0000 1.3 *************** *** 26,30 **** .I \-i Selects the ethernet interface to use to connect to the device. By ! default eth0 is used. .TP --- 26,30 ---- .I \-i Selects the ethernet interface to use to connect to the device. By ! default the value of environment variable MOPRC_INTERFACE or "eth0" is used. .TP *************** *** 50,53 **** --- 50,59 ---- .br moprc -i eth1 08:00:2B:2B:AD:99 + + .SH ENVIRONMENT VARIABLES + + MOPRC_INTERFACE defines the default interface to use if + not specified on the command line. If not present the interface "eth0" + will be used. .SS SEE ALSO Index: moprc.c =================================================================== RCS file: /cvsroot/linux-decnet/latd/moprc.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** moprc.c 3 Jan 2003 15:53:06 -0000 1.6 --- moprc.c 12 Jan 2003 16:17:09 -0000 1.7 *************** *** 1,4 **** /****************************************************************************** ! (c) 2001-2002 patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2001-2003 patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 183,186 **** --- 183,187 ---- int interface = find_interface("eth0"); int trigger=0; + char *env; struct ether_addr addr; *************** *** 188,191 **** --- 189,201 ---- { return usage(stdout, argv[0]); + } + + /* Look for MOPRC_INTERFACE environment variable */ + env = getenv("MOPRC_INTERFACE"); + if (env) + { + int envif = find_interface(env); + if (envif > 1) + interface = envif; } |
From: Patrick C. <pa...@us...> - 2003-01-10 12:07:15
|
Update of /cvsroot/linux-decnet/latd/debian In directory sc8-pr-cvs1:/tmp/cvs-serv9991/debian Modified Files: changelog Log Message: Changes in 1.16 Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/latd/debian/changelog,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** changelog 14 Aug 2002 07:59:49 -0000 1.11 --- changelog 10 Jan 2003 12:07:11 -0000 1.12 *************** *** 1,2 **** --- 1,19 ---- + latd (1.16-1) unstable; urgency=low + + * Don't use an IP socket for finding interfaces. So now you + can use LAT (& moprc) with a kernel that doesn't have IP. + * Fix latcp man page (-J and -j were wrong way round) + * llogin -L disables locking when using -p + * latd now expires services if it doesn't receive HELLOs + * Expand escape sequences in /etc/issue.net or /etc/issue.lat + * Fix crash on queued connections referencing freed memory. + * moprc now ignores duplicate messages it receives. This fixes + odd behaviour with some Emulex targets + * Put a timeout on CONNECT and COMMAND messages so we can resend + them if we get no reply. + * Check connection IDs more carefully. + + -- Patrick Caulfield <pa...@de...> Fri, 10 Jan 2003 10:18:00 +0000 + latd (1.15-1) unstable; urgency=low |
From: Patrick C. <pa...@us...> - 2003-01-10 12:07:15
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv9991 Modified Files: NEWS Log Message: Changes in 1.16 Index: NEWS =================================================================== RCS file: /cvsroot/linux-decnet/latd/NEWS,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** NEWS 3 Jan 2002 08:46:55 -0000 1.22 --- NEWS 10 Jan 2003 12:07:10 -0000 1.23 *************** *** 1,2 **** --- 1,70 ---- + latd (1.16-1) unstable; urgency=low + + * Don't use an IP socket for finding interfaces. So now you + can use LAT (& moprc) with a kernel that doesn't have IP. + * Fix latcp man page (-J and -j were wrong way round) + * llogin -L disables locking when using -p + * latd now expires services if it doesn't receive HELLOs + * Expand escape sequences in /etc/issue.net or /etc/issue.lat + * Fix crash on queued connections referencing freed memory. + * moprc now ignores duplicate messages it receives. This fixes + odd behaviour with some Emulex targets + * Put a timeout on CONNECT and COMMAND messages so we can resend + them if we get no reply. + * Check connection IDs more carefully. + + -- Patrick Caulfield <pa...@de...> Fri, 10 Jan 2003 10:18:00 +0000 + + latd (1.15-1) unstable; urgency=low + + * More DS90L+ fixes (keepalive message format) + * Fix iostreams so they produce the correct output in gcc 3.0 & 2.95. + Now I know why people really hate iostreams. + * Use getloadavg() rather than /proc to get load average. + * Close all FDs before forking server processes. + * Always send an ACK for a packet with data in it. + * llogin uses lock files for device connections + + -- Patrick Caulfield <pa...@de...> Wed, 14 Aug 2002 08:56:28 +0100 + + latd (1.14-1) unstable; urgency=low + + * gcc-3.0 compilation fixes in the new bits + * Rewritten ethernet flow control + * Increase moprc timeout a little. + * Don't try to process zero-length packets + * Include lat.html documentation + * Tested on DECserver 700 + * Send "no more slots on circuit" message when closing a connection for + that reason. Fixes reconnection on DECserver 90L+ + + -- Patrick Caulfield <pa...@de...> Wed, 19 Mar 2002 19:23:34 +0000 + + latd (1.13-1) unstable; urgency=low + + * Fail attempts to create /dev/lat ports twice + * Delete /dev/lat ports when latcp -D -p is run + (thanks to Denis Komissarov) for those two. + * Use local name in ENQ message for DS90L servers instead of the + stupid one I left in there after testing. + * Get rid of spurious "Queued" status messages and put the + service name in there. + * Fix multiple queued connections to the same server that I broke in 1.11 + * Don't make queued connection queries interfere with existing services table + * Restrict data slots to 250 bytes so as not to break DECserver 200s + * Made the keepalive timer less susceptible to drift on busy systems. + + -- Patrick Caulfield <pa...@de...> Sat, 16 Feb 2002 16:25:52 +0000 + + latd (1.12-1) unstable; urgency=low + + * llogin -r is an alias for llogin -R (easier to type!) + * New moprc program for remote administration of terminal servers + * llogin can now connect to passworded services using llogin -w + * Split out Linux-specific code into its own class + * Primitive, but functional support for DS90L terminal servers + + -- Patrick Caulfield <pa...@de...> Mon, 11 Feb 2002 17:02:13 +0000 + latd (1.11-1) unstable; urgency=low *************** *** 12,16 **** latd (1.10-1) unstable; urgency=low ! * Can now handle multiple reverse-LAT connections via the same connection (llogin only) * Can specify a command to run (and user to run it under) for a named service. --- 80,84 ---- latd (1.10-1) unstable; urgency=low ! * Can now handle multiple reverse-LAT connections via the same connection (llogin only) * Can specify a command to run (and user to run it under) for a named service. *************** *** 22,26 **** * Use std:: namespace so it compiles with GCC 3.0 * Don't use makedepend for dependancy management. ! * Don't depend on libstdc++2.10-dev. Closes: bug#104954 * Fix includes in server.cc that depend for GLIBC version --- 90,94 ---- * Use std:: namespace so it compiles with GCC 3.0 * Don't use makedepend for dependancy management. ! * Don't depend on libstdc++2.10-dev. Closes: bug#104954 * Fix includes in server.cc that depend for GLIBC version *************** *** 39,43 **** * Fixed EOF trapping on local ports * Fixed latcp -d display of local ports (node & service were swapped) ! * Changed example latd.conf to show we can connect to services without specifying a node name now * Closes: bug#85288 --- 107,111 ---- * Fixed EOF trapping on local ports * Fixed latcp -d display of local ports (node & service were swapped) ! * Changed example latd.conf to show we can connect to services without specifying a node name now * Closes: bug#85288 *************** *** 66,70 **** ports with no other privileges * Added startup script ! * Remove "LAT started", "LAT stopped" messages from latcp as they interfere with the startup script and it's "not the Unix way" * Added RPM build target --- 134,138 ---- ports with no other privileges * Added startup script ! * Remove "LAT started", "LAT stopped" messages from latcp as they interfere with the startup script and it's "not the Unix way" * Added RPM build target |
From: Patrick C. <pa...@us...> - 2003-01-10 12:06:26
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv9360 Modified Files: Makefile Log Message: bump version number delete moprc during "make clean" Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/latd/Makefile,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -r1.35 -r1.36 *** Makefile 8 Jan 2003 19:00:30 -0000 1.35 --- Makefile 10 Jan 2003 12:06:16 -0000 1.36 *************** *** 1,5 **** # Makefile for LAT server ! VERSION=1.15 PKGNAME=latd --- 1,5 ---- # Makefile for LAT server ! VERSION=1.16 PKGNAME=latd *************** *** 89,93 **** clean: rm -f .depend ! rm -f $(PROG1) $(PROG2) $(PROG3) *.o *.bak .depend core rm -rf debian/tmp --- 89,93 ---- clean: rm -f .depend ! rm -f $(PROG1) $(PROG2) $(PROG3) $(PROG4) *.o *.bak .depend core rm -rf debian/tmp |
From: Patrick C. <pa...@us...> - 2003-01-10 09:01:09
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv5984 Modified Files: server.cc Log Message: Check connection IDs from terminal servers a little more carefully Thanks to Denis Komissarov Index: server.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.cc,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -r1.62 -r1.63 *** server.cc 14 Oct 2002 14:45:13 -0000 1.62 --- server.cc 10 Jan 2003 09:01:04 -0000 1.63 *************** *** 540,544 **** { debuglog(("session cmd for connid %d\n", header->remote_connid)); ! LATConnection *conn = connections[header->remote_connid]; if (conn) { --- 540,549 ---- { debuglog(("session cmd for connid %d\n", header->remote_connid)); ! LATConnection *conn = NULL; ! if(header->remote_connid < MAX_CONNECTIONS) ! { ! conn = connections[header->remote_connid]; ! } ! if (conn) { *************** *** 584,588 **** LATConnection *conn = NULL; debuglog(("Got connect ACK for %d\n", header->remote_connid)); ! if (header->remote_connid <= MAX_CONNECTIONS) { conn = connections[header->remote_connid]; --- 589,593 ---- LATConnection *conn = NULL; debuglog(("Got connect ACK for %d\n", header->remote_connid)); ! if (header->remote_connid < MAX_CONNECTIONS) { conn = connections[header->remote_connid]; *************** *** 608,612 **** buf[sizeof(LAT_Header)], lat_messages::connection_disconnect_msg(buf[sizeof(LAT_Header)]) )); ! if (header->remote_connid <= MAX_CONNECTIONS) { LATConnection *conn = connections[header->remote_connid]; --- 613,617 ---- buf[sizeof(LAT_Header)], lat_messages::connection_disconnect_msg(buf[sizeof(LAT_Header)]) )); ! if (header->remote_connid < MAX_CONNECTIONS) { LATConnection *conn = connections[header->remote_connid]; |
From: Patrick C. <pa...@us...> - 2003-01-08 19:00:38
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv13841 Modified Files: Makefile Log Message: Add -Wno-deprecated to CXXFLAGS for warning-free compilation with GCC 3. actually fixing the includes will break gcc 2.95 Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/latd/Makefile,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -r1.34 -r1.35 *** Makefile 14 Aug 2002 09:00:59 -0000 1.34 --- Makefile 8 Jan 2003 19:00:30 -0000 1.35 *************** *** 34,38 **** CXX=g++ CC=gcc ! CXXFLAGS+=$(OPTDEBUG) $(DEFS) -pipe -Wstrict-prototypes -Wall -fno-rtti -fno-exceptions CFLAGS+=$(OPTDEBUG) $(DEFS) -pipe -Wstrict-prototypes -Wall --- 34,38 ---- CXX=g++ CC=gcc ! CXXFLAGS+=$(OPTDEBUG) $(DEFS) -pipe -Wstrict-prototypes -Wall -fno-rtti -fno-exceptions -Wno-deprecated CFLAGS+=$(OPTDEBUG) $(DEFS) -pipe -Wstrict-prototypes -Wall |
From: Patrick C. <pa...@us...> - 2003-01-07 10:57:27
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv14272 Modified Files: connection.cc connection.h Log Message: Add a timer to CONNECT and COMMAND messages so they can be resent if a response does not arrive in time. Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -r1.50 -r1.51 *** connection.cc 25 Dec 2002 11:45:38 -0000 1.50 --- connection.cc 7 Jan 2003 10:57:24 -0000 1.51 *************** *** 59,63 **** eightbitclean(false), connected(false), ! master_conn(NULL), role(SERVER) { --- 59,64 ---- eightbitclean(false), connected(false), ! master_conn(NULL), ! last_msg_type(0), role(SERVER) { *************** *** 102,107 **** eightbitclean(clean), connected(false), ! master_conn(NULL), connecting(false), role(CLIENT) { --- 103,109 ---- eightbitclean(clean), connected(false), ! master_conn(NULL), connecting(false), + last_msg_type(0), role(CLIENT) { *************** *** 310,313 **** --- 312,317 ---- else { + last_msg_type = 0; + // Connect a new port session to it ClientSession *cs = (ClientSession *)(*master_conn)->sessions[1]; *************** *** 679,682 **** --- 683,780 ---- } + // If we're waiting for a non-flow-contorl message then + // check for timeout. + if (last_msg_type) + { + time_t tt; + tt = time(NULL); + + if (tt - last_msg_time > 5) + { + last_msg_time = tt; + + switch (last_msg_type) + { + // Connect + case LAT_CCMD_CONNECT: + { + + // Send another connect command + int ptr; + unsigned char buf[1600]; + LAT_Start *msg = (LAT_Start *)buf; + ptr = sizeof(LAT_Start); + + debuglog(("Resending connect to service on interface %d\n", interface)); + + msg->header.cmd = LAT_CCMD_CONNECT; + msg->header.num_slots = 0; + msg->header.local_connid = num; + + msg->maxsize = dn_htons(1500); + msg->latver = LAT_VERSION; + msg->latver_eco = LAT_VERSION_ECO; + msg->maxsessions = 254; + msg->exqueued = 0; + msg->circtimer = LATServer::Instance()->get_circuit_timer(); + msg->keepalive = LATServer::Instance()->get_keepalive_timer(); + msg->facility = dn_htons(0); // Eh? + msg->prodtype = 3; // Wot do we use here??? + msg->prodver = 3; // and here ??? + + add_string(buf, &ptr, remnode); + add_string(buf, &ptr, LATServer::Instance()->get_local_node()); + add_string(buf, &ptr, (unsigned char *)LATServer::greeting); + + send_message(buf, ptr, LATConnection::DATA); + return; + } + break; + + // Request for queued connect + case LAT_CCMD_COMMAND: + { + int ptr; + unsigned char buf[1600]; + LAT_Command *msg = (LAT_Command *)buf; + ptr = sizeof(LAT_Command); + + debuglog(("Resending queued connect to service on interface %d\n", interface)); + + msg->cmd = LAT_CCMD_COMMAND; + msg->format = 0; + msg->hiver = LAT_VERSION; + msg->lover = LAT_VERSION; + msg->latver = LAT_VERSION; + msg->latver_eco = LAT_VERSION_ECO; + msg->maxsize = dn_htons(1500); + msg->request_id = num; + msg->entry_id = 0; + msg->opcode = 2; // Request Queued connection + msg->modifier = 1; // Send status periodically + + add_string(buf, &ptr, remnode); + + buf[ptr++] = 32; // Groups length + memcpy(buf + ptr, LATServer::Instance()->get_user_groups(), 32); + ptr += 32; + + add_string(buf, &ptr, LATServer::Instance()->get_local_node()); + buf[ptr++] = 0; // ASCIC source port + add_string(buf, &ptr, (unsigned char *)LATServer::greeting); + add_string(buf, &ptr, servicename); + add_string(buf, &ptr, portname); + + // Send it raw. + LATServer::Instance()->send_message(buf, ptr, interface, macaddr); + return; + } + break; + default: + break; + } + } + } + retransmit_count = 0; *************** *** 948,951 **** --- 1046,1054 ---- add_string(buf, &ptr, portname); + // Save the time we sent the connect so we + // know if we got a response. + last_msg_time = time(NULL); + last_msg_type = msg->cmd; + // Send it raw. return LATServer::Instance()->send_message(buf, ptr, interface, macaddr); *************** *** 979,982 **** --- 1082,1090 ---- add_string(buf, &ptr, (unsigned char *)LATServer::greeting); + // Save the time we sent the connect so we + // know if we got a response. + last_msg_time = time(NULL); + last_msg_type = msg->header.cmd; + return send_message(buf, ptr, LATConnection::DATA); } *************** *** 999,1002 **** --- 1107,1111 ---- if (role == CLIENT && sessions[1]) { + last_msg_type = 0; ClientSession *s = (ClientSession *)sessions[1]; s->show_status(node, entry); *************** *** 1054,1057 **** --- 1163,1168 ---- window_size = 0; need_ack = false; + + last_msg_type = 0; // Not waiting anymore debuglog(("got connect ack. seq: %d, ack: %d\n", Index: connection.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** connection.h 25 Dec 2002 11:45:38 -0000 1.25 --- connection.h 7 Jan 2003 10:57:24 -0000 1.26 *************** *** 82,85 **** --- 82,89 ---- bool connecting; + // Keep track of non-flow-controlled messages + time_t last_msg_time; + int last_msg_type; + int next_session_number(); void send_a_reply(unsigned char local_session, unsigned char remote_session); |
From: Patrick C. <pa...@us...> - 2003-01-03 15:53:10
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv8602 Modified Files: moprc.c Log Message: Ignore duplicate messages received from the remote end. Index: moprc.c =================================================================== RCS file: /cvsroot/linux-decnet/latd/moprc.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** moprc.c 26 Aug 2002 08:32:11 -0000 1.5 --- moprc.c 3 Jan 2003 15:53:06 -0000 1.6 *************** *** 446,449 **** --- 446,450 ---- struct termios new_term; int len; + int last_msg_tag = 99; /* Dummy */ int status; int timeout = 200000; /* Poll interval */ *************** *** 517,520 **** --- 518,526 ---- cmd = buf[2]; datalen = buf[0] | buf[1] <<8; + + /* Ignore duplicates */ + if (last_msg_tag == buf[3]) + continue; + last_msg_tag = buf[3]; switch (cmd) |
From: Patrick C. <pa...@us...> - 2002-12-25 11:45:42
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv1250 Modified Files: connection.h server.h connection.cc serversession.cc session.cc Log Message: master_conn is now a pointer to the real connection pointer, so it goes NULL when it should. Thanks to Denis Komissarov Index: connection.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** connection.h 15 Mar 2002 19:20:46 -0000 1.24 --- connection.h 25 Dec 2002 11:45:38 -0000 1.25 *************** *** 79,83 **** bool eightbitclean; bool connected; ! LATConnection *master_conn; // Client connection we are slave to bool connecting; --- 79,83 ---- bool eightbitclean; bool connected; ! LATConnection **master_conn; // Client connection we are slave to bool connecting; Index: server.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.h,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -r1.38 -r1.39 *** server.h 6 Sep 2002 09:01:28 -0000 1.38 --- server.h 25 Dec 2002 11:45:38 -0000 1.39 *************** *** 51,55 **** int get_service_info(char *name, std::string &cmd, int &maxcon, uid_t &uid, gid_t &gid); gid_t get_lat_group() { return lat_group; } ! LATConnection *get_connection(int id) { return (id < MAX_CONNECTIONS)?connections[id]:NULL; } const unsigned char *get_user_groups() { return user_groups; } int find_connection_by_node(const char *node); --- 51,55 ---- int get_service_info(char *name, std::string &cmd, int &maxcon, uid_t &uid, gid_t &gid); gid_t get_lat_group() { return lat_group; } ! LATConnection **get_connection(int id) { return &connections[id]; } const unsigned char *get_user_groups() { return user_groups; } int find_connection_by_node(const char *node); Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -r1.49 -r1.50 *** connection.cc 21 Dec 2002 12:17:59 -0000 1.49 --- connection.cc 25 Dec 2002 11:45:38 -0000 1.50 *************** *** 59,62 **** --- 59,63 ---- eightbitclean(false), connected(false), + master_conn(NULL), role(SERVER) { *************** *** 81,85 **** window_size = 0; lat_eco = msg->latver_eco; - max_slots_per_packet = 4; --- 82,85 ---- *************** *** 102,105 **** --- 102,106 ---- eightbitclean(clean), connected(false), + master_conn(NULL), connecting(false), role(CLIENT) *************** *** 296,300 **** { master_conn = LATServer::Instance()->get_connection(queued_connection); ! if (!master_conn) { debuglog(("Got queued reconnect for non-existant request ID\n")); --- 297,301 ---- { master_conn = LATServer::Instance()->get_connection(queued_connection); ! if (!(*master_conn)) { debuglog(("Got queued reconnect for non-existant request ID\n")); *************** *** 310,314 **** { // Connect a new port session to it ! ClientSession *cs = (ClientSession *)master_conn->sessions[1]; newsessionnum = next_session_number(); --- 311,315 ---- { // Connect a new port session to it ! ClientSession *cs = (ClientSession *)(*master_conn)->sessions[1]; newsessionnum = next_session_number(); *************** *** 318,322 **** slotcmd->remote_session, newsessionnum, ! master_conn->eightbitclean); if (newsession->new_session(remnode, "","", credits) == -1) --- 319,323 ---- slotcmd->remote_session, newsessionnum, ! (*master_conn)->eightbitclean); if (newsession->new_session(remnode, "","", credits) == -1) *************** *** 593,601 **** if (queued_slave) { ! ClientSession *cs = NULL; ! if (master_conn) ! cs = (ClientSession *)master_conn->sessions[1]; if (cs) cs->restart_pty(); } else { --- 594,602 ---- if (queued_slave) { ! if((*master_conn)) { ! ClientSession *cs = (ClientSession *)(*master_conn)->sessions[1]; if (cs) cs->restart_pty(); } + } else { Index: serversession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/serversession.cc,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** serversession.cc 19 May 2002 12:33:59 -0000 1.14 --- serversession.cc 25 Dec 2002 11:45:38 -0000 1.15 *************** *** 1,4 **** /****************************************************************************** ! (c) 2000 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2000-2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 135,143 **** add_slot(buf, ptr, 0x0f, slotbuf, 0); - slotbuf[slotptr++] = 0x0D; - slotbuf[slotptr++] = 0x0A; - slotbuf[slotptr++] = 0x0D; - add_slot(buf, ptr, 0x0f, slotbuf, 0); - parent.queue_message(buf, ptr); --- 135,138 ---- *************** *** 218,222 **** } ! /* Hopefully this will work for BSDs as well as Linux */ #ifdef RLIMIT_NOFILE --- 213,217 ---- } ! /* Hopefully this will work for BSDs as well as Linux */ #ifdef RLIMIT_NOFILE *************** *** 289,293 **** // Set some environment variables. ! // login will clear these it's true but other // services may find them useful. setenv("LAT_LOCAL_SERVICE", parent.get_servicename(), 1); --- 284,288 ---- // Set some environment variables. ! // /bin/login will clear these it's true but other // services may find them useful. setenv("LAT_LOCAL_SERVICE", parent.get_servicename(), 1); Index: session.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/session.cc,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -r1.34 -r1.35 *** session.cc 23 Oct 2002 07:37:19 -0000 1.34 --- session.cc 25 Dec 2002 11:45:38 -0000 1.35 *************** *** 122,126 **** { // Disable the FD so we don't start looping ! if (!stopped) { LATServer::Instance()->set_fd_state(master_fd, true); --- 122,126 ---- { // Disable the FD so we don't start looping ! if (!stopped) { LATServer::Instance()->set_fd_state(master_fd, true); *************** *** 131,134 **** --- 131,138 ---- } msglen = read(master_fd, buf, max_read_size); + // TODO BUG: + // If the the PTY is closed while we are stopped then we + // don't notice until the remote end sends more credit... + #ifdef REALLY_VERBOSE_DEBUGLOG *************** *** 244,247 **** --- 248,252 ---- tcflow(master_fd, TCOOFF); } + return 0; } |
From: Patrick C. <pa...@us...> - 2002-12-21 12:19:46
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv30154 Modified Files: TODO Log Message: Add to list of things I will probably NOT do Index: TODO =================================================================== RCS file: /cvsroot/linux-decnet/latd/TODO,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** TODO 12 Feb 2002 13:36:14 -0000 1.13 --- TODO 21 Dec 2002 12:19:42 -0000 1.14 *************** *** 9,12 **** --- 9,14 ---- ------------------- - Keep counters + - Allow applications to change the serial characteristics + (probably too hard because of the port actually being PTYs) - Support windows larger than 1 - Allow /etc/issue.net files longer than 255 characters |
From: Patrick C. <pa...@us...> - 2002-12-21 12:18:28
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv29999 Modified Files: README Log Message: fix typo Index: README =================================================================== RCS file: /cvsroot/linux-decnet/latd/README,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** README 19 May 2002 12:53:13 -0000 1.9 --- README 21 Dec 2002 12:18:25 -0000 1.10 *************** *** 19,23 **** - llogin program so users can log into LAT services from Linux - moprc for remote management for terminal servers. ! - To send BREAK to a remote server in a revsese-LAT session press ^@ You will need Packet Socket support in the kernel, but I think that's --- 19,23 ---- - llogin program so users can log into LAT services from Linux - moprc for remote management for terminal servers. ! - To send BREAK to a remote server in a reverse-LAT session press ^@ You will need Packet Socket support in the kernel, but I think that's |
From: Patrick C. <pa...@us...> - 2002-12-21 12:18:03
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1:/tmp/cvs-serv29876 Modified Files: connection.cc Log Message: Check master_conn is not-NULL before de-referencing it. Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -r1.48 -r1.49 *** connection.cc 22 Oct 2002 19:44:24 -0000 1.48 --- connection.cc 21 Dec 2002 12:17:59 -0000 1.49 *************** *** 593,597 **** if (queued_slave) { ! ClientSession *cs = (ClientSession *)master_conn->sessions[1]; if (cs) cs->restart_pty(); } --- 593,599 ---- if (queued_slave) { ! ClientSession *cs = NULL; ! if (master_conn) ! cs = (ClientSession *)master_conn->sessions[1]; if (cs) cs->restart_pty(); } |
From: Patrick C. <pa...@us...> - 2002-12-15 19:43:32
|
Update of /cvsroot/linux-decnet/dnprogs/apps In directory sc8-pr-cvs1:/tmp/cvs-serv15519 Modified Files: sethost.c Log Message: Don't spin-loop if the other end dies for any reason (eg you just shut it down!) Index: sethost.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/apps/sethost.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** sethost.c 9 Aug 2002 08:20:08 -0000 1.6 --- sethost.c 15 Dec 2002 19:43:29 -0000 1.7 *************** *** 1654,1658 **** ioctl(sockfd,FIONREAD,&numbytes); cnt=read(sockfd,buf,numbytes); ! if (cnt < 0) { unbind = TRUE; --- 1654,1658 ---- ioctl(sockfd,FIONREAD,&numbytes); cnt=read(sockfd,buf,numbytes); ! if (cnt <= 0) { unbind = TRUE; |
From: Patrick C. <pa...@us...> - 2002-11-04 11:20:37
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory usw-pr-cvs1:/tmp/cvs-serv1550/debian Modified Files: changelog Log Message: NEWS and changelog for 2.22 Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/changelog,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** changelog 13 Sep 2002 12:00:55 -0000 1.21 --- changelog 4 Nov 2002 11:20:33 -0000 1.22 *************** *** 1,6 **** dnprogs (2.21-1) unstable; urgency=low * Don't check_kernel when building DEBS so ! autobuilders can built it. Instead default to kernel 2.4.x Previously I had done this manually but I often forgot, this should remove that possibility --- 1,28 ---- + dnprogs (2.22-1) unstable; urgency=low + + * Make some bits of dncopy conditional on it being connected to VMS. + This helps with RSX connectivity. + * Fix bug in fal where it sends an extra newline at the end of a text file. + * Make .fal metadata directories 0777 so multiple users can use them. + * Make metadata file have the same protection as the real file + * Make records array (for VAR files) increase by 100s rather than 10s as + that's far too weedy. + * Red Hat startup scripts sets node name and default device now. + * getnodename & setnodename in libdnet actually work now. + * Tidy PTY definitions in Makefile.common & fix PTYs in rmtermd. + Thanks to Maciej W. Rozycki + * Fixes and chkconfig to the Red Hat startup script. + Thanks to Mats Magnusson + * Added loads of new error messages to libdap so it should be able to + make sense of most DAP errors now. + * Minor changes to debian control files to get rid of lintian/linda + warnings. + + -- Patrick Caulfield <pa...@de...> Sat, 2 Nov 2002 18:18:02 +0000 + dnprogs (2.21-1) unstable; urgency=low * Don't check_kernel when building DEBS so ! autobuilders can build it. Instead default to kernel 2.4.x Previously I had done this manually but I often forgot, this should remove that possibility |