linux-decnet-commit Mailing List for DECnet for Linux (Page 41)
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...> - 2001-12-08 13:18:33
|
Update of /cvsroot/linux-decnet/dnprogs In directory usw-pr-cvs1:/tmp/cvs-serv27189 Modified Files: Makefile.common Log Message: Bump version number to 2.18 Index: Makefile.common =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/Makefile.common,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** Makefile.common 2001/11/09 14:38:29 1.13 --- Makefile.common 2001/12/08 13:18:31 1.14 *************** *** 54,58 **** MAJOR_VERSION=2 ! MINOR_VERSION=17 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) --- 54,58 ---- MAJOR_VERSION=2 ! MINOR_VERSION=18 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) |
From: Patrick C. <pa...@us...> - 2001-12-08 12:21:09
|
Update of /cvsroot/linux-decnet/dnprogs/fal In directory usw-pr-cvs1:/tmp/cvs-serv19375 Modified Files: task.cc Log Message: Actually send binary files as blocked rather than just say we will. Index: task.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/task.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** task.cc 2001/06/19 10:49:18 1.4 --- task.cc 2001/12/08 12:21:06 1.5 *************** *** 617,620 **** --- 617,621 ---- block_size = 512; if (verbose > 1) DAPLOG((LOG_INFO, "sending file %s as blocked binary\n", name)); + send_records = false; return true; } |
From: Patrick C. <pa...@us...> - 2001-12-08 12:20:14
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory usw-pr-cvs1:/tmp/cvs-serv19180 Modified Files: control Log Message: dnet-progs Must depend on libdnet. It's incumbent on /me/ to make sure that libdnet is not installed when I build the package. Index: control =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/control,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** control 2001/11/05 10:11:03 1.17 --- control 2001/12/08 12:20:11 1.18 *************** *** 25,29 **** Package: dnet-progs Architecture: any ! Depends: ${shlibs:Depends} Priority: extra Section: net --- 25,29 ---- Package: dnet-progs Architecture: any ! Depends: ${shlibs:Depends}, libdnet(>=${Source-Version}) Priority: extra Section: net |
From: Patrick C. <pa...@us...> - 2001-11-30 13:57:58
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv18480 Modified Files: Tag: TAG_BRANCH_1_10 moprc.h Log Message: You'll need this too. Index: moprc.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/Attic/moprc.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -r1.1.2.1 -r1.1.2.2 *** moprc.h 2001/11/20 18:30:28 1.1.2.1 --- moprc.h 2001/11/30 13:57:54 1.1.2.2 *************** *** 5,8 **** --- 5,9 ---- #define MOPRC_CMD_RELEASE 0x0F #define MOPRC_CMD_REQUESTID 0x05 + #define MOPRC_CMD_BOOT 0x06 #define MOPRC_CMD_SYSTEMID 0x07 #define MOPRC_CMD_COMMANDPOLL 0x11 |
From: Patrick C. <pa...@us...> - 2001-11-30 13:55:19
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv17997 Modified Files: Tag: TAG_BRANCH_1_10 moprc.c moprc.8 Log Message: Add trigger command so you can remote-reboot servers. Index: moprc.c =================================================================== RCS file: /cvsroot/linux-decnet/latd/Attic/moprc.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -r1.1.2.3 -r1.1.2.4 *** moprc.c 2001/11/21 17:53:48 1.1.2.3 --- moprc.c 2001/11/30 13:55:15 1.1.2.4 *************** *** 59,62 **** --- 59,63 ---- static int show_info = 0; static int do_moprc(char *, int); + static int send_boot(char *macaddr, int interface); static int usage(FILE *f, char *cmd) *************** *** 68,71 **** --- 69,73 ---- 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"); *************** *** 73,77 **** fprintf(f, "MAC addresses in colon-seperated form. eg:\n"); fprintf(f, "\n%s -i eth1 08:00:2B:2B:AD:99\n", cmd); ! fprintf(f, "\nYou will probably need to be root to run this program.\n"); fprintf(f, "\n"); return -1; --- 75,80 ---- 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; *************** *** 179,182 **** --- 182,186 ---- int opt; int interface = find_interface("eth0"); + int trigger=0; struct ether_addr addr; *************** *** 189,193 **** opterr = 0; optind = 0; ! while ((opt=getopt(argc,argv,"?hVvi:")) != EOF) { switch(opt) --- 193,197 ---- opterr = 0; optind = 0; ! while ((opt=getopt(argc,argv,"?hVvti:")) != EOF) { switch(opt) *************** *** 203,206 **** --- 207,214 ---- break; + case 't': + trigger++; + break; + case 'i': interface = find_interface(optarg); *************** *** 245,248 **** --- 253,261 ---- if (mop_socket == -1) exit(4); + if (trigger) + { + return send_boot(addr.ether_addr_octet, interface); + } + return do_moprc(addr.ether_addr_octet, interface); } *************** *** 315,318 **** --- 328,344 ---- } + static int send_boot(char *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(char *data, int len, char *macaddr, int interface) { *************** *** 389,393 **** /* Other stuff */ case 201: ! printf("Operating Syetem: "); print_ascic(&info[index], infolen); break; --- 415,419 ---- /* Other stuff */ case 201: ! printf("Operating System: "); print_ascic(&info[index], infolen); break; Index: moprc.8 =================================================================== RCS file: /cvsroot/linux-decnet/latd/Attic/moprc.8,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -r1.1.2.2 -r1.1.2.3 *** moprc.8 2001/11/21 17:53:48 1.1.2.2 --- moprc.8 2001/11/30 13:55:15 1.1.2.3 *************** *** 33,36 **** --- 33,41 ---- .TP + .I \-t + Trigger the node. This normally reboots the server so use this + with care! + + .TP .I \-h \-? Shows the usage message. |
From: Patrick C. <pa...@us...> - 2001-11-21 17:53:51
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv17542 Modified Files: Tag: TAG_BRANCH_1_10 moprc.8 moprc.c Makefile Log Message: Show Node information if asked. Index: moprc.8 =================================================================== RCS file: /cvsroot/linux-decnet/latd/Attic/moprc.8,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -r1.1.2.1 -r1.1.2.2 *** moprc.8 2001/11/21 12:53:00 1.1.2.1 --- moprc.8 2001/11/21 17:53:48 1.1.2.2 *************** *** 29,32 **** --- 29,36 ---- .TP + .I \-v + Shows some information about the node that is connected to + + .TP .I \-h \-? Shows the usage message. Index: moprc.c =================================================================== RCS file: /cvsroot/linux-decnet/latd/Attic/moprc.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -r1.1.2.2 -r1.1.2.3 *** moprc.c 2001/11/21 10:02:28 1.1.2.2 --- moprc.c 2001/11/21 17:53:48 1.1.2.3 *************** *** 57,65 **** static char last_message[1500]; static int last_message_len; static int do_moprc(char *, int); static int usage(FILE *f, char *cmd) { ! fprintf(f, "\nUsage: %s [?hV] [-i <interface>] <node name>|<macaddr>\n", cmd); fprintf(f, " -? Show this usage message\n"); --- 57,66 ---- static char last_message[1500]; static int last_message_len; + static int show_info = 0; static int do_moprc(char *, int); 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"); *************** *** 67,70 **** --- 68,72 ---- fprintf(f, " -V Show the version of moprc\n"); fprintf(f, " -i Ethernet interface to use (default eth0)\n"); + fprintf(f, " -v Show target information\n"); fprintf(f, "\n"); fprintf(f, "Node names are read from /etc/ethers\n"); *************** *** 187,191 **** opterr = 0; optind = 0; ! while ((opt=getopt(argc,argv,"?hVi:")) != EOF) { switch(opt) --- 189,193 ---- opterr = 0; optind = 0; ! while ((opt=getopt(argc,argv,"?hVvi:")) != EOF) { switch(opt) *************** *** 197,200 **** --- 199,206 ---- return usage(stdout, argv[0]); + case 'v': + show_info++; + break; + case 'i': interface = find_interface(optarg); *************** *** 326,329 **** --- 332,414 ---- } + static void print_ascic(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; + + 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 Syetem: "); + 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(char *macaddr, int interface) { *************** *** 422,429 **** for (i=0; i<datalen-2; i++) { ! if ( (buf[4+i] >= 32 && buf[4+i] < 127) || ! buf[4+i]=='\r' || buf[4+i] == '\n') ! printf("%c", buf[4+i]); ! } fflush(stdout); --- 507,511 ---- for (i=0; i<datalen-2; i++) { ! fputc(buf[4+i], stdout); } fflush(stdout); *************** *** 436,444 **** if (state == STARTING) { if (isatty(STDIN_FILENO)) printf("Console connected (press CTRL/D when finished)\n"); state = CONNECTED; - // TODO Check response & print server info. } break; --- 518,531 ---- 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; Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/latd/Makefile,v retrieving revision 1.23.2.7 retrieving revision 1.23.2.8 diff -C2 -r1.23.2.7 -r1.23.2.8 *** Makefile 2001/11/21 12:53:00 1.23.2.7 --- Makefile 2001/11/21 17:53:48 1.23.2.8 *************** *** 1,5 **** # Makefile for LAT server ! VERSION=1.11 PKGNAME=latd --- 1,5 ---- # Makefile for LAT server ! VERSION=1.12 PKGNAME=latd *************** *** 30,33 **** --- 30,34 ---- OPTDEBUG=-g CXX=g++ + CC=gcc CXXFLAGS+=$(OPTDEBUG) $(DEFS) -pipe -Wstrict-prototypes -Wall -fno-rtti -fno-exceptions CFLAGS+=$(OPTDEBUG) $(DEFS) -pipe -Wstrict-prototypes -Wall *************** *** 64,68 **** $(PROG4): depend $(PROG4OBJS) ! $(CC) -o $@ $(PROG4OBJS) install: --- 65,69 ---- $(PROG4): depend $(PROG4OBJS) ! $(CC) $(CFLAGS) -o $@ $(PROG4OBJS) install: *************** *** 93,97 **** rm -f .depend rm -rf debian/tmp ! cd ..; tar czf latd-$(VERSION).tar.gz latd/*.h latd/*.cc \ latd/BUGS latd/README latd/NEWS latd/Makefile \ latd/WARRANTY latd/COPYING latd/INSTALL latd/TODO \ --- 94,98 ---- 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/WARRANTY latd/COPYING latd/INSTALL latd/TODO \ |
From: Patrick C. <pa...@us...> - 2001-11-21 12:53:04
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv31768 Modified Files: Tag: TAG_BRANCH_1_10 Makefile Added Files: Tag: TAG_BRANCH_1_10 moprc.8 Log Message: Man page for moprc --- NEW FILE: moprc.8 --- .TH MOPRC 8 "November 21 2001" "MOP Remote Console" .SH NAME moprc \- MOP Remote console requestor .SH SYNOPSIS .B moprc [options] <nodename>|<MAC Address> .br .SH DESCRIPTION .PP .B moprc allows a system administrator to connect to MOP console devices (usually terminal servers) and log into them to issue commands remotely. It is the equivalent of "NCP CONNECT NODE" or "SET HOST/MOP" on VMS. .br The node maybe specified as a MAC address in Unix format (ie as 6 pairs of hex digits seperated by colons) or as a name that appears in /etc/ethers. .br Because moprc uses the PF_PACKET socket feature of Linux you will probably need to be root or have privileges to use moprc. .SS OPTIONS .TP .I \-i Selects the ethernet interface to use to connect to the device. By default eth0 is used. .TP .I \-h \-? Shows the usage message. .TP .I \-V Shows the version of moprc. .SH EXAMPLES moprc ds200 .br .br moprc -i eth1 08:00:2B:2B:AD:99 .SS SEE ALSO .BR latd "(8), " latd.conf "(5), " ethers "(5), " llogin "(1)" Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/latd/Makefile,v retrieving revision 1.23.2.6 retrieving revision 1.23.2.7 diff -C2 -r1.23.2.6 -r1.23.2.7 *** Makefile 2001/11/20 18:30:28 1.23.2.6 --- Makefile 2001/11/21 12:53:00 1.23.2.7 *************** *** 11,15 **** MANPAGES1=llogin.1 MANPAGES5=latd.conf.5 ! MANPAGES8=latd.8 latcp.8 PROG1OBJS=main.o utils.o server.o connection.o session.o \ serversession.o clientsession.o queuedsession.o services.o \ --- 11,15 ---- 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 \ |
From: Patrick C. <pa...@us...> - 2001-11-21 10:02:31
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv27081 Modified Files: Tag: TAG_BRANCH_1_10 moprc.c Log Message: Fixed all sorts of things. Index: moprc.c =================================================================== RCS file: /cvsroot/linux-decnet/latd/Attic/moprc.c,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -r1.1.2.1 -r1.1.2.2 *** moprc.c 2001/11/20 18:30:28 1.1.2.1 --- moprc.c 2001/11/21 10:02:28 1.1.2.2 *************** *** 37,40 **** --- 37,41 ---- #include <assert.h> #include <netinet/in.h> + #include <netinet/ether.h> #include <features.h> /* for the glibc version number */ #if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || __GLIBC__ >= 3 *************** *** 53,66 **** #include "moprc.h" ! static int mop_socket; ! static int do_moprc(char *, int); ! ! static void usage(FILE *f) ! { ! fprintf(f, "Usage: \n"); } /* Find the interface named <ifname> and return it's number - Also save the MAC address in <macaddr>. Return -1 if we didn't find it or it's not ethernet, */ --- 54,80 ---- #include "moprc.h" ! static int mop_socket; ! static char last_message[1500]; ! static int last_message_len; ! static int do_moprc(char *, int); ! ! static int usage(FILE *f, char *cmd) ! { ! fprintf(f, "\nUsage: %s [?hV] [-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, "\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); ! fprintf(f, "\nYou will probably need to be root to run this program.\n"); ! fprintf(f, "\n"); ! return -1; } /* Find the interface named <ifname> and return it's number Return -1 if we didn't find it or it's not ethernet, */ *************** *** 77,81 **** if (strcmp(ifr.ifr_name, ifname) == 0) { ! // Also check it's ethernet while we are here ioctl(sock, SIOCGIFHWADDR, &ifr); if (ifr.ifr_hwaddr.sa_family != ARPHRD_ETHER) --- 91,95 ---- if (strcmp(ifr.ifr_name, ifname) == 0) { ! /* Also check it's ethernet while we are here */ ioctl(sock, SIOCGIFHWADDR, &ifr); if (ifr.ifr_hwaddr.sa_family != ARPHRD_ETHER) *************** *** 89,93 **** ifr.ifr_ifindex = ++iindex; } ! // Didn't find it close(sock); return -1; --- 103,107 ---- ifr.ifr_ifindex = ++iindex; } ! /* Didn't find it */ close(sock); return -1; *************** *** 100,104 **** struct sockaddr_ll sock_info; ! // Open LAT protocol socket mop_socket = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_DNA_RC)); if (mop_socket < 0) --- 114,118 ---- struct sockaddr_ll sock_info; ! /* Open MOP protocol socket */ mop_socket = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_DNA_RC)); if (mop_socket < 0) *************** *** 136,144 **** sock_info.sll_protocol = htons(ETH_P_DNA_RC); sock_info.sll_ifindex = interface; ! sock_info.sll_hatype = 0;//ARPHRD_ETHER; sock_info.sll_pkttype = PACKET_MULTICAST; sock_info.sll_halen = 6; memcpy(sock_info.sll_addr, macaddr, 6); if (sendto(mop_socket, buf, len, 0, (struct sockaddr *)&sock_info, sizeof(sock_info)) < 0) --- 150,161 ---- sock_info.sll_protocol = htons(ETH_P_DNA_RC); sock_info.sll_ifindex = interface; ! sock_info.sll_hatype = 0; sock_info.sll_pkttype = PACKET_MULTICAST; sock_info.sll_halen = 6; memcpy(sock_info.sll_addr, macaddr, 6); + memcpy(last_message, buf, len); + last_message_len = len; + if (sendto(mop_socket, buf, len, 0, (struct sockaddr *)&sock_info, sizeof(sock_info)) < 0) *************** *** 151,165 **** } int main(int argc, char *argv[]) { int opt; ! int interface = 1; ! int a,b,c,d,e,f; ! char macaddr[6]; if (argc < 2) { ! usage(stdout); ! exit(1); } --- 168,185 ---- } + static int send_last_message(int interface, unsigned char *macaddr) + { + return send_message(last_message, last_message_len, interface, macaddr); + } + int main(int argc, char *argv[]) { int opt; ! int interface = find_interface("eth0"); ! struct ether_addr addr; if (argc < 2) { ! return usage(stdout, argv[0]); } *************** *** 172,181 **** { case 'h': ! usage(stdout); ! exit(1); case '?': ! usage(stderr); ! exit(1); case 'i': --- 192,199 ---- { case 'h': ! return usage(stdout, argv[0]); case '?': ! return usage(stdout, argv[0]); case 'i': *************** *** 190,194 **** case 'V': printf("\nMoprc version %s\n\n", VERSION); ! exit(1); break; } --- 208,212 ---- case 'V': printf("\nMoprc version %s\n\n", VERSION); ! exit(0); break; } *************** *** 197,222 **** if (!argv[optind]) { ! usage(stderr); ! exit(1); } ! /* Parse ethernet MAC address */ ! if (sscanf(argv[optind], "%x-%x-%x-%x-%x-%x", &a, &b, &c, &d, &e, &f) != 6) { ! usage(stderr); ! exit(3); ! } ! macaddr[0]=a; ! macaddr[1]=b; ! macaddr[2]=c; ! macaddr[3]=d; ! macaddr[4]=e; ! macaddr[5]=f; mop_socket = open_mop_socket(interface); if (mop_socket == -1) exit(4); ! return do_moprc(macaddr, interface); } --- 215,243 ---- 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; ! } ! } mop_socket = open_mop_socket(interface); if (mop_socket == -1) exit(4); ! return do_moprc(addr.ether_addr_octet, interface); } *************** *** 309,326 **** enum {STARTING, CONNECTED} state=STARTING; fd_set in; - struct timeval tv; - int len; - int status; - int timeout = 100000; /* Poll interval */ unsigned char buf[1500]; ! int termfd = STDIN_FILENO; struct termios old_term; struct termios new_term; ! int waiting_ack = 1; tcgetattr(termfd, &old_term); new_term = old_term; ! // Set local terminal characteristics new_term.c_iflag &= ~BRKINT; new_term.c_iflag |= IGNBRK | INLCR; --- 330,348 ---- 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 status; ! int timeout = 160000; /* 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; *************** *** 335,343 **** send_reserve(macaddr, interface); send_reqid(macaddr, interface); /* Main loop */ FD_ZERO(&in); FD_SET(mop_socket, &in); - FD_SET(STDIN_FILENO, &in); tv.tv_sec = 5; tv.tv_usec = 0; --- 357,365 ---- 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; *************** *** 346,349 **** --- 368,372 ---- while ( (status = select(mop_socket+1, &in, NULL, NULL, &tv)) >= 0) { + /* No data, poll for any input from the terminal server */ if (status == 0 && !waiting_ack) { *************** *** 351,356 **** send_data(dummybuf, 0, macaddr, interface); waiting_ack = 1; } ! if (FD_ISSET(mop_socket, &in)) // From Them to us { int cmd; --- 374,394 ---- 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; *************** *** 368,372 **** cmd = buf[2]; datalen = buf[0] | buf[1] <<8; ! // if (datalen !=2) fprintf(stderr, "got cmd %x, len %d\n", cmd, datalen); switch (cmd) { --- 406,410 ---- cmd = buf[2]; datalen = buf[0] | buf[1] <<8; ! switch (cmd) { *************** *** 377,380 **** --- 415,419 ---- break; + /* Got some data to display */ case MOPRC_CMD_RESPONSE: if (datalen >= 2) *************** *** 392,399 **** break; case MOPRC_CMD_SYSTEMID: if (state == STARTING) { ! printf("Console connected (press CTRL/D when finished)\n"); state = CONNECTED; --- 431,441 ---- break; + /* Response to our REQUESTID message means + we are connected */ case MOPRC_CMD_SYSTEMID: if (state == STARTING) { ! if (isatty(STDIN_FILENO)) ! printf("Console connected (press CTRL/D when finished)\n"); state = CONNECTED; *************** *** 406,410 **** } } ! if (FD_ISSET(STDIN_FILENO, &in)) // from us to Them { int i; --- 448,454 ---- } } ! ! /* Keyboard input */ ! if (FD_ISSET(STDIN_FILENO, &in)) { int i; *************** *** 424,448 **** } waiting_ack = 1; send_data(buf, len, macaddr, interface); } ! if (state == STARTING) ! { ! printf("Target does not respond\n"); ! break; ! } ! else ! { ! tv.tv_usec = timeout; ! tv.tv_sec = 0; ! } ! // Reset for another select FD_ZERO(&in); FD_SET(mop_socket, &in); if (!waiting_ack) FD_SET(STDIN_FILENO, &in); - } finished: ! // Send disconnect send_release(macaddr, interface); --- 468,486 ---- } 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); |
From: Patrick C. <pa...@us...> - 2001-11-20 18:30:31
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv16003 Modified Files: Tag: TAG_BRANCH_1_10 Makefile Added Files: Tag: TAG_BRANCH_1_10 moprc.c moprc.h Log Message: Added moprc command --- NEW FILE: moprc.c --- /****************************************************************************** (c) 2001 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/in.h> #include <features.h> /* for the glibc version number */ #if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || __GLIBC__ >= 3 #include <netpacket/packet.h> #include <net/ethernet.h> /* the L2 protocols */ #include <net/if_arp.h> #include <linux/if.h> #else #include <asm/types.h> #include <linux/if.h> #include <linux/if_arp.h> #include <linux/if_packet.h> #include <linux/if_ether.h> /* The L2 protocols */ #endif #include "moprc.h" static int mop_socket; static int do_moprc(char *, int); static void usage(FILE *f) { fprintf(f, "Usage: \n"); } /* Find the interface named <ifname> and return it's number Also save the MAC address in <macaddr>. Return -1 if we didn't find it or it's not ethernet, */ static int find_interface(char *ifname) { struct ifreq ifr; int iindex = 1; int sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); ifr.ifr_ifindex = iindex; while (ioctl(sock, SIOCGIFNAME, &ifr) == 0) { if (strcmp(ifr.ifr_name, ifname) == 0) { // Also check it's ethernet while we are here ioctl(sock, SIOCGIFHWADDR, &ifr); if (ifr.ifr_hwaddr.sa_family != ARPHRD_ETHER) { fprintf(stderr, "Device %s is not ethernet\n", ifname); return -1; } close(sock); return iindex; } ifr.ifr_ifindex = ++iindex; } // Didn't find it close(sock); return -1; } static int open_mop_socket(int interface) { int mop_socket; struct sockaddr_ll sock_info; // Open LAT protocol socket mop_socket = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_DNA_RC)); if (mop_socket < 0) { fprintf(stderr, "Can't create MOP protocol socket: %s\n", strerror(errno)); exit(1); } /* Build the sockaddr_ll structure */ sock_info.sll_family = AF_PACKET; sock_info.sll_protocol = htons(ETH_P_DNA_RC); sock_info.sll_ifindex = interface; if (bind(mop_socket, (struct sockaddr *)&sock_info, sizeof(sock_info))) { perror("can't bind MOPRC socket: %m\n"); return -1; } return mop_socket; } /* Send a MOP message to a specified MAC address */ static int send_message(unsigned char *buf, int len, int interface, unsigned char *macaddr) { struct sockaddr_ll sock_info; if (len < 46) len = 46; /* Build the sockaddr_ll structure */ sock_info.sll_family = AF_PACKET; sock_info.sll_protocol = htons(ETH_P_DNA_RC); sock_info.sll_ifindex = interface; sock_info.sll_hatype = 0;//ARPHRD_ETHER; sock_info.sll_pkttype = PACKET_MULTICAST; sock_info.sll_halen = 6; memcpy(sock_info.sll_addr, macaddr, 6); if (sendto(mop_socket, buf, len, 0, (struct sockaddr *)&sock_info, sizeof(sock_info)) < 0) { perror("Sending packet"); return -1; } return 0; } int main(int argc, char *argv[]) { int opt; int interface = 1; int a,b,c,d,e,f; char macaddr[6]; if (argc < 2) { usage(stdout); exit(1); } /* Get command-line options */ opterr = 0; optind = 0; while ((opt=getopt(argc,argv,"?hVi:")) != EOF) { switch(opt) { case 'h': usage(stdout); exit(1); case '?': usage(stderr); exit(1); case 'i': interface = find_interface(optarg); if (interface == -1) { fprintf(stderr, "Unknown interface: %s\n", optarg); return 2; } break; case 'V': printf("\nMoprc version %s\n\n", VERSION); exit(1); break; } } if (!argv[optind]) { usage(stderr); exit(1); } /* Parse ethernet MAC address */ if (sscanf(argv[optind], "%x-%x-%x-%x-%x-%x", &a, &b, &c, &d, &e, &f) != 6) { usage(stderr); exit(3); } macaddr[0]=a; macaddr[1]=b; macaddr[2]=c; macaddr[3]=d; macaddr[4]=e; macaddr[5]=f; mop_socket = open_mop_socket(interface); if (mop_socket == -1) exit(4); return do_moprc(macaddr, interface); } static int readmop(int mop_socket, char *buf, int buflen) { struct msghdr msg; struct iovec iov; struct sockaddr_ll sock_info; int len; msg.msg_name = &sock_info; msg.msg_namelen = sizeof(sock_info); msg.msg_iovlen = 1; msg.msg_iov = &iov; iov.iov_len = buflen; iov.iov_base = buf; len = recvmsg(mop_socket, &msg, 0); if (len < 0) { if (errno != EINTR) return -1; else return 0; } /* Ignore packets captured in promiscuous mode. */ if (sock_info.sll_pkttype == PACKET_OTHERHOST) { return 0; } return len; } static int send_reserve(char *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(char *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(char *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_data(char *data, int len, char *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 int do_moprc(char *macaddr, int interface) { enum {STARTING, CONNECTED} state=STARTING; fd_set in; struct timeval tv; int len; int status; int timeout = 100000; /* Poll interval */ unsigned char buf[1500]; int termfd = STDIN_FILENO; struct termios old_term; struct termios new_term; int waiting_ack = 1; 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); /* Main loop */ FD_ZERO(&in); FD_SET(mop_socket, &in); FD_SET(STDIN_FILENO, &in); tv.tv_sec = 5; tv.tv_usec = 0; /* Loop for input */ while ( (status = select(mop_socket+1, &in, NULL, NULL, &tv)) >= 0) { if (status == 0 && !waiting_ack) { char dummybuf[1]; send_data(dummybuf, 0, macaddr, interface); waiting_ack = 1; } if (FD_ISSET(mop_socket, &in)) // From Them to us { int cmd; int datalen; len = readmop(mop_socket, 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; // if (datalen !=2) fprintf(stderr, "got cmd %x, len %d\n", cmd, datalen); switch (cmd) { case MOPRC_CMD_RESERVE: case MOPRC_CMD_RELEASE: case MOPRC_CMD_REQUESTID: fprintf(stderr, "Got unsupported MOPRC function %d\n", cmd); break; case MOPRC_CMD_RESPONSE: if (datalen >= 2) { int i; for (i=0; i<datalen-2; i++) { if ( (buf[4+i] >= 32 && buf[4+i] < 127) || buf[4+i]=='\r' || buf[4+i] == '\n') printf("%c", buf[4+i]); } fflush(stdout); } break; case MOPRC_CMD_SYSTEMID: if (state == STARTING) { printf("Console connected (press CTRL/D when finished)\n"); state = CONNECTED; // TODO Check response & print server info. } break; default: fprintf(stderr, "Got unknown MOPRC function %d\n", cmd); break; } } if (FD_ISSET(STDIN_FILENO, &in)) // from us to Them { 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; send_data(buf, len, macaddr, interface); } if (state == STARTING) { printf("Target does not respond\n"); break; } else { tv.tv_usec = timeout; tv.tv_sec = 0; } // Reset for another select 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; } --- NEW FILE: moprc.h --- /* MOPRC commands, the ones we use anyway */ #define MOPRC_CMD_RESERVE 0x0D #define MOPRC_CMD_RELEASE 0x0F #define MOPRC_CMD_REQUESTID 0x05 #define MOPRC_CMD_SYSTEMID 0x07 #define MOPRC_CMD_COMMANDPOLL 0x11 #define MOPRC_CMD_RESPONSE 0x13 Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/latd/Makefile,v retrieving revision 1.23.2.5 retrieving revision 1.23.2.6 diff -C2 -r1.23.2.5 -r1.23.2.6 *** Makefile 2001/11/08 19:13:47 1.23.2.5 --- Makefile 2001/11/20 18:30:28 1.23.2.6 *************** *** 8,11 **** --- 8,12 ---- PROG2=latcp PROG3=llogin + PROG4=moprc MANPAGES1=llogin.1 MANPAGES5=latd.conf.5 *************** *** 17,20 **** --- 18,22 ---- PROG2OBJS=latcp.o utils.o PROG3OBJS=llogin.o utils.o + PROG4OBJS=moprc.o DEFS=-DVERSION=\"$(VERSION)\" -DLATCP_SOCKNAME=\"$(LATCPSOCK)\" -DLLOGIN_SOCKNAME=\"$(LLOGINSOCK)\" *************** *** 29,32 **** --- 31,35 ---- CXX=g++ CXXFLAGS+=$(OPTDEBUG) $(DEFS) -pipe -Wstrict-prototypes -Wall -fno-rtti -fno-exceptions + CFLAGS+=$(OPTDEBUG) $(DEFS) -pipe -Wstrict-prototypes -Wall # ARCH code taken from the Linux kernel sources. *************** *** 49,53 **** # Targets: # ! all: $(PROG1) $(PROG2) $(PROG3) $(PROG1): depend $(PROG1OBJS) --- 52,56 ---- # Targets: # ! all: $(PROG1) $(PROG2) $(PROG3) $(PROG4) $(PROG1): depend $(PROG1OBJS) *************** *** 60,63 **** --- 63,69 ---- $(CXX) -o $@ $(PROG3OBJS) + $(PROG4): depend $(PROG4OBJS) + $(CC) -o $@ $(PROG4OBJS) + install: install -d $(prefix)/sbin *************** *** 69,72 **** --- 75,79 ---- 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 |
From: Patrick C. <pa...@us...> - 2001-11-20 10:18:04
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv10644 Modified Files: Tag: TAG_BRANCH_1_10 TODO Log Message: More to do, but some done. Index: TODO =================================================================== RCS file: /cvsroot/linux-decnet/latd/TODO,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -r1.11 -r1.11.2.1 *** TODO 2001/02/19 19:17:02 1.11 --- TODO 2001/11/20 10:17:59 1.11.2.1 *************** *** 2,8 **** ---- ! - Check multiple sessions on the same connection. How many slots can I ! get away with sending? (and stuff like that) ! - Test service responder - can someone do this for me please?? THINGS I MAY NOT DO --- 2,8 ---- ---- ! - Test service responder. ! - Allow reverse-LAT to DECserver 90L+ ! - Find out we send so many more packets than Tru64 THINGS I MAY NOT DO *************** *** 11,15 **** - Support windows larger than 1 - Allow /etc/issue.net files longer than 255 characters - - Support multiple client sessions in one connection - (see BUGS for implications of this) - Put the protocol bits into the kernel. --- 11,13 ---- |
From: Patrick C. <pa...@us...> - 2001-11-14 09:40:52
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv849 Modified Files: Tag: TAG_BRANCH_1_10 llogin.cc Log Message: It helps if you add the command to the getopt string too... Index: llogin.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogin.cc,v retrieving revision 1.9.2.4 retrieving revision 1.9.2.5 diff -C2 -r1.9.2.4 -r1.9.2.5 *** llogin.cc 2001/11/14 09:32:10 1.9.2.4 --- llogin.cc 2001/11/14 09:40:49 1.9.2.5 *************** *** 107,111 **** if (ttyname(0)) strcpy(localport, ttyname(0)); ! while ((opt=getopt(argc,argv,"dpcvhlbQH:R:q:n:")) != EOF) { switch(opt) --- 107,111 ---- if (ttyname(0)) strcpy(localport, ttyname(0)); ! while ((opt=getopt(argc,argv,"dpcvhlbQH:R:r:q:n:")) != EOF) { switch(opt) |
From: Patrick C. <pa...@us...> - 2001-11-14 09:32:14
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv30916 Modified Files: Tag: TAG_BRANCH_1_10 llogin.cc Log Message: -r is now a synonym for -R 'cos I hate commands with capital letters in them! Index: llogin.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogin.cc,v retrieving revision 1.9.2.3 retrieving revision 1.9.2.4 diff -C2 -r1.9.2.3 -r1.9.2.4 *** llogin.cc 2001/09/11 13:16:17 1.9.2.3 --- llogin.cc 2001/11/14 09:32:10 1.9.2.4 *************** *** 71,74 **** --- 71,75 ---- printf (" -H <node> remote node name\n"); printf (" -R <port> remote port name\n"); + printf (" -r <port> remote port name\n"); printf (" -Q connect to a queued service\n"); printf (" -c convert input CR to LF\n"); *************** *** 101,105 **** { exit(usage(argv[0])); ! } // Set the default local port name --- 102,106 ---- { exit(usage(argv[0])); ! } // Set the default local port name *************** *** 108,112 **** while ((opt=getopt(argc,argv,"dpcvhlbQH:R:q:n:")) != EOF) { ! switch(opt) { case 'd': --- 109,113 ---- while ((opt=getopt(argc,argv,"dpcvhlbQH:R:q:n:")) != EOF) { ! switch(opt) { case 'd': *************** *** 150,153 **** --- 151,155 ---- case 'R': + case 'r': strcpy(port, optarg); break; *************** *** 190,204 **** // This is the same as latcp -d -l send_msg(latcp_socket, LATCP_SHOWSERVICE, verboseflag, 1); ! unsigned char *result; int len; int cmd; read_reply(latcp_socket, cmd, result, len); ! cout << result; ! ! delete[] result; return 0; ! } make_upper(node); --- 192,206 ---- // This is the same as latcp -d -l send_msg(latcp_socket, LATCP_SHOWSERVICE, verboseflag, 1); ! unsigned char *result; int len; int cmd; read_reply(latcp_socket, cmd, result, len); ! cout << result; ! ! delete[] result; return 0; ! } make_upper(node); *************** *** 236,244 **** { unsigned char head[3]; ! // Get the message header (cmd & length) if (read(fd, head, sizeof(head)) != 3) return -1; // Bad header ! len = head[1] * 256 + head[2]; cmd = head[0]; --- 238,246 ---- { unsigned char head[3]; ! // Get the message header (cmd & length) if (read(fd, head, sizeof(head)) != 3) return -1; // Bad header ! len = head[1] * 256 + head[2]; cmd = head[0]; *************** *** 256,260 **** return -1; } ! return 0; } --- 258,262 ---- return -1; } ! return 0; } *************** *** 263,270 **** { struct sockaddr_un sockaddr; ! latcp_socket = socket(AF_UNIX, SOCK_STREAM, PF_UNIX); if (latcp_socket == -1) ! { if (!quiet) perror("Can't create socket"); return false; /* arggh ! */ --- 265,272 ---- { struct sockaddr_un sockaddr; ! latcp_socket = socket(AF_UNIX, SOCK_STREAM, PF_UNIX); if (latcp_socket == -1) ! { if (!quiet) perror("Can't create socket"); return false; /* arggh ! */ *************** *** 279,283 **** return false; } ! unsigned char *result; int len; --- 281,285 ---- return false; } ! unsigned char *result; int len; *************** *** 285,289 **** // Send our version ! send_msg(latcp_socket, LATCP_VERSION, VERSION, strlen(VERSION)+1); read_reply(latcp_socket, cmd, result, len); // Read version number back --- 287,291 ---- // Send our version ! send_msg(latcp_socket, LATCP_VERSION, VERSION, strlen(VERSION)+1); read_reply(latcp_socket, cmd, result, len); // Read version number back *************** *** 305,309 **** { unsigned char outhead[3]; ! outhead[0] = cmd; outhead[1] = len/256; --- 307,311 ---- { unsigned char outhead[3]; ! outhead[0] = cmd; outhead[1] = len/256; *************** *** 363,370 **** if (endchar >0 && inbuf[i] == endchar) goto quit; ! if (inbuf[i] == '\n' && crlf) inbuf[i] = '\r'; ! if (inbuf[i] == '\177' && bsdel) inbuf[i] = '\010'; --- 365,372 ---- if (endchar >0 && inbuf[i] == endchar) goto quit; ! if (inbuf[i] == '\n' && crlf) inbuf[i] = '\r'; ! if (inbuf[i] == '\177' && bsdel) inbuf[i] = '\010'; *************** *** 391,395 **** } } ! quit: // Reset terminal attributes tcsetattr(termfd, TCSANOW, &old_term); --- 393,397 ---- } } ! quit: // Reset terminal attributes tcsetattr(termfd, TCSANOW, &old_term); *************** *** 428,432 **** // Be a terminal terminal(termfd, quit_char, crlf, bsdel, lfvt); ! // Reset terminal attributes tcsetattr(termfd, TCSANOW, &old_term); --- 430,434 ---- // Be a terminal terminal(termfd, quit_char, crlf, bsdel, lfvt); ! // Reset terminal attributes tcsetattr(termfd, TCSANOW, &old_term); |
From: Patrick C. <pa...@us...> - 2001-11-09 14:58:59
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory usw-pr-cvs1:/tmp/cvs-serv17831/debian Modified Files: libdnet.postinst Log Message: s/f/if/ Index: libdnet.postinst =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/libdnet.postinst,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** libdnet.postinst 2001/11/05 10:11:03 1.4 --- libdnet.postinst 2001/11/09 14:58:56 1.5 *************** *** 3,7 **** set -e ! f [ "$1" = "configure" ]; then ldconfig fi --- 3,7 ---- set -e ! if [ "$1" = "configure" ]; then ldconfig fi |
From: Patrick C. <pa...@us...> - 2001-11-09 14:38:32
|
Update of /cvsroot/linux-decnet/dnprogs In directory usw-pr-cvs1:/tmp/cvs-serv9728 Modified Files: Makefile.common Log Message: Bump version no. to 2.17 Index: Makefile.common =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/Makefile.common,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** Makefile.common 2001/10/21 14:24:00 1.12 --- Makefile.common 2001/11/09 14:38:29 1.13 *************** *** 54,58 **** MAJOR_VERSION=2 ! MINOR_VERSION=16 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) --- 54,58 ---- MAJOR_VERSION=2 ! MINOR_VERSION=17 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) |
From: Patrick C. <pa...@us...> - 2001-11-09 14:38:00
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory usw-pr-cvs1:/tmp/cvs-serv9513/debian Modified Files: changelog Log Message: ChangeLog for 2.17 Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/changelog,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** changelog 2001/10/21 14:24:00 1.16 --- changelog 2001/11/09 14:37:57 1.17 *************** *** 1,4 **** ! dnprogs (2.16-1potato) unstable; urgency=low * Remove pre-increment in FAL so that close-time attributes get applied to the right file - and don't crash on the last file. --- 1,17 ---- ! dnprogs (2.17-1) unstable; urgency=low + * Don't print "done" when stopping daemons in dnet-progs.init.d + * Use cuserid() rather than getlogin() to determine username so that + commands run under su and sudo work as expected + * include <stdarg> in rms/getreply.cc so it compiles on hppa + * Use -fsigned-char when building uulib to make it more portable + * Fixed message "Error opening file for input: Success" when attempting + to fetch a locked file using dncopy + * Fix some lintian warnings + + -- Patrick Caulfield <pa...@de...> Wed, 7 Nov 2001 15:15:28 +0000 + + dnprogs (2.16-1) unstable; urgency=low + * Remove pre-increment in FAL so that close-time attributes get applied to the right file - and don't crash on the last file. *************** *** 6,10 **** * fal's directory output now correctly sends the new directory information if a double wildcard is used: eg [*]* ! * Fix bug in fal where binary files got corrupted if copied in "record" mode * setether now also sets the default interface for 2.4 kernels --- 19,23 ---- * fal's directory output now correctly sends the new directory information if a double wildcard is used: eg [*]* ! * Fix bug in fal where binary files got corrupted if copied in "record" mode * setether now also sets the default interface for 2.4 kernels *************** *** 14,20 **** dnprogs (2.15-1) unstable; urgency=low ! * in librms/parse.cc pass va_list in a wrapper struct so that it works on ! powerpc systems. Closes: bug#111680 ! * add set -e to Makefile so it gives up on error. I never was any good at writing Makefiles. * Minor manpage changes. --- 27,33 ---- dnprogs (2.15-1) unstable; urgency=low ! * in librms/parse.cc pass va_list in a wrapper struct so that it works on ! powerpc systems. Closes: bug#111680 ! * add set -e to Makefile so it gives up on error. I never was any good at writing Makefiles. * Minor manpage changes. *************** *** 63,67 **** * Fix crash in libdap if the first byte of a message is the last byte of a packet. ! * Add man page symlinks for dnet_accet/dnet_reject and dnet_endnode/dnet_nextnode. Closes: bug#99611 --- 76,80 ---- * Fix crash in libdap if the first byte of a message is the last byte of a packet. ! * Add man page symlinks for dnet_accet/dnet_reject and dnet_endnode/dnet_nextnode. Closes: bug#99611 *************** *** 82,86 **** * First Debian upload. Closes: bug#83642 * Split into 4 packages. ! * FAL now correctly uses metadata for block-structured files. -- Patrick Caulfield <pa...@de...> Sun, 4 Feb 2001 14:23:07 +0000 --- 95,99 ---- * First Debian upload. Closes: bug#83642 * Split into 4 packages. ! * FAL now correctly uses metadata for block-structured files. -- Patrick Caulfield <pa...@de...> Sun, 4 Feb 2001 14:23:07 +0000 *************** *** 104,110 **** about with it. * This file is now a Debian changelog ! -- Patrick Caulfield <pa...@de...> Sat, 28 Jan 2000 15:13:09 +0000 ! dnprogs (2.06-1) stable; urgency=low --- 117,123 ---- about with it. * This file is now a Debian changelog ! -- Patrick Caulfield <pa...@de...> Sat, 28 Jan 2000 15:13:09 +0000 ! dnprogs (2.06-1) stable; urgency=low *************** *** 114,118 **** * Fixed & tidied RPM building * Fixed phone bug so you can dial users by node number now ! * A small number of potential buffer overflows removed from dnetd & libdnet_daemon * Fixed compilation of phone on SuSE 6.4 & RedHat 6.2 systems --- 127,131 ---- * Fixed & tidied RPM building * Fixed phone bug so you can dial users by node number now ! * A small number of potential buffer overflows removed from dnetd & libdnet_daemon * Fixed compilation of phone on SuSE 6.4 & RedHat 6.2 systems *************** *** 122,126 **** * ctermd no longer goes into a tight loop if you ^Y^Y the session * Updated my email address ! -- Patrick Caulfield <pa...@ty...> Sat, 28 Oct 2000 19:33:06 +0000 --- 135,139 ---- * ctermd no longer goes into a tight loop if you ^Y^Y the session * Updated my email address ! -- Patrick Caulfield <pa...@ty...> Sat, 28 Oct 2000 19:33:06 +0000 *************** *** 132,138 **** -- Patrick Caulfield <pa...@pa...> Mon, 3 Apr 2000 19:33:06 +0000 ! dnprogs (2.04-1) stable; urgency=low ! * Fixed random crash in FAL when creating multiple files * Fixed a memory leak in dncopy sending multiple files --- 145,151 ---- -- Patrick Caulfield <pa...@pa...> Mon, 3 Apr 2000 19:33:06 +0000 ! dnprogs (2.04-1) stable; urgency=low ! * Fixed random crash in FAL when creating multiple files * Fixed a memory leak in dncopy sending multiple files *************** *** 147,162 **** most obvious when editting a large file via EDT and quitting near the top. * Removed dncopy.README as it didn't say anything anyway ! * Include a modified dnping with all sorts of new features, submitted by Rob Davies. man page by me. * Sethost now supports RSTS and TOPS-20. Thanks to Paul Koning for the patch. ! * Include rmtermd from Paul Koning so you can connect your PDP machines to Linux too. ! ! -- Patrick Caulfield <pa...@pa...> Sat, 5 Feb 2000 19:33:06 +0000 dnprogs (2.03-1) stable; urgency=low * RPMs now include the decnetconf script. ! * RPMs now include some previously missing man pages * Corrected dndir so that it works with DECnet/E. Thanks to Paul Koning <pk...@xe...> for the patch. I've reworked it --- 160,175 ---- most obvious when editting a large file via EDT and quitting near the top. * Removed dncopy.README as it didn't say anything anyway ! * Include a modified dnping with all sorts of new features, submitted by Rob Davies. man page by me. * Sethost now supports RSTS and TOPS-20. Thanks to Paul Koning for the patch. ! * Include rmtermd from Paul Koning so you can connect your PDP machines to Linux too. ! ! -- Patrick Caulfield <pa...@pa...> Sat, 5 Feb 2000 19:33:06 +0000 dnprogs (2.03-1) stable; urgency=low * RPMs now include the decnetconf script. ! * RPMs now include some previously missing man pages * Corrected dndir so that it works with DECnet/E. Thanks to Paul Koning <pk...@xe...> for the patch. I've reworked it *************** *** 175,179 **** * ctermd no longer uses 'login -p' * Fixed the DAP client buffer size from 65536 to 65535. D'oh! Only my FAL ! barfed on this piece of (probably alcohol induced) stupidity; and it shouldn't have. * In FAL dir node::"/dir" now adds a "/*" to the end of the name so you get --- 188,192 ---- * ctermd no longer uses 'login -p' * Fixed the DAP client buffer size from 65536 to 65535. D'oh! Only my FAL ! barfed on this piece of (probably alcohol induced) stupidity; and it shouldn't have. * In FAL dir node::"/dir" now adds a "/*" to the end of the name so you get *************** *** 199,204 **** system on-the-fly. ! -- Patrick Caulfield <pa...@pa...> Thu, 9 Dec 1999 19:33:06 +0000 ! dnprogs (2.02-1) stable; urgency=low --- 212,217 ---- system on-the-fly. ! -- Patrick Caulfield <pa...@pa...> Thu, 9 Dec 1999 19:33:06 +0000 ! dnprogs (2.02-1) stable; urgency=low *************** *** 207,213 **** * Bug fixes to KEYed reads in librms * Added new functions to librms for easier programming - -- Patrick Caulfield <pa...@pa...> Thu, 21 Oct 1999 19:33:06 +0000 - dnprogs (2.01-1) stable; urgency=low --- 220,226 ---- * Bug fixes to KEYed reads in librms * Added new functions to librms for easier programming + + -- Patrick Caulfield <pa...@pa...> Thu, 21 Oct 1999 19:33:06 +0000 dnprogs (2.01-1) stable; urgency=low *************** *** 218,226 **** * Fixed blocking(!) * New function in libdnet: dnet_recv(). This function is designed to hide ! the differences between recv() in the 'Eduardo' and 'Steve' kernels in that it will always read a full record before returning. - -- Patrick Caulfield <pa...@pa...> Fri, 15 Jul 1999 19:33:06 +0000 - dnprogs (2.00-1) stable; urgency=medium --- 231,239 ---- * Fixed blocking(!) * New function in libdnet: dnet_recv(). This function is designed to hide ! the differences between recv() in the 'Eduardo' and 'Steve' kernels in that it will always read a full record before returning. + + -- Patrick Caulfield <pa...@pa...> Fri, 15 Jul 1999 19:33:06 +0000 dnprogs (2.00-1) stable; urgency=medium *************** *** 237,246 **** DECnet if /etc/decnet.conf exists * Added Steve's dnet_ntop and dnet_pton functions to libdnet - -- Patrick Caulfield <pa...@pa...> Sun, 11 Jul 1999 19:33:06 +0000 - - dnprogs (1.94-1) stable; urgency=low ! * Tidied error messages from dndel * Fixed Makefile for librms --- 250,259 ---- DECnet if /etc/decnet.conf exists * Added Steve's dnet_ntop and dnet_pton functions to libdnet + + -- Patrick Caulfield <pa...@pa...> Sun, 11 Jul 1999 19:33:06 +0000 + dnprogs (1.94-1) stable; urgency=low ! * Tidied error messages from dndel * Fixed Makefile for librms *************** *** 255,259 **** dnprogs (1.93-1) stable; urgency=low ! * All libraries are now release under the LGPL. Thanks to Eduardo and Steve for allowing me to change the licence on their parts of this software --- 268,272 ---- dnprogs (1.93-1) stable; urgency=low ! * All libraries are now release under the LGPL. Thanks to Eduardo and Steve for allowing me to change the licence on their parts of this software *************** *** 271,277 **** * NEW! librms library to help people write Linux applications that read VMS files (including indexed ones) - - -- Patrick Caulfield <pa...@pa...> Fri, 23 May 1999 19:33:06 +0000 dnprogs (1.92-1) stable; urgency=low --- 284,290 ---- * NEW! librms library to help people write Linux applications that read VMS files (including indexed ones) + -- Patrick Caulfield <pa...@pa...> Fri, 23 May 1999 19:33:06 +0000 + dnprogs (1.92-1) stable; urgency=low *************** *** 285,291 **** * First stab at FAL file type guessing. Opinions please!! ! -- Patrick Caulfield <pa...@pa...> Fri, 9 May 1999 19:33:06 +0000 ! dnprogs (1.91-1) stable; urgency=low * This is a pre-release of dnprogs 2.0 --- 298,304 ---- * First stab at FAL file type guessing. Opinions please!! ! -- Patrick Caulfield <pa...@pa...> Fri, 9 May 1999 19:33:06 +0000 ! dnprogs (1.91-1) stable; urgency=low * This is a pre-release of dnprogs 2.0 *************** *** 310,314 **** that (can be) forked by dnetd or run standalone. * Re-worked all daemon programs to use libdnet_daemon ! ! -- Patrick Caulfield <pa...@pa...> Fri, 3 May 1999 19:33:06 +0000 --- 323,327 ---- that (can be) forked by dnetd or run standalone. * Re-worked all daemon programs to use libdnet_daemon ! ! -- Patrick Caulfield <pa...@pa...> Fri, 3 May 1999 19:33:06 +0000 |
From: Patrick C. <pa...@us...> - 2001-11-08 19:13:50
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv10568 Modified Files: Tag: TAG_BRANCH_1_10 Makefile clientsession.cc connection.cc connection.h localport.cc localportsession.cc localportsession.h session.cc Log Message: Added minimum_read to localportsession.cc - needs latcp support. Added support for sending data in ACK messages. Remove some trailing spaces Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/latd/Makefile,v retrieving revision 1.23.2.4 retrieving revision 1.23.2.5 diff -C2 -r1.23.2.4 -r1.23.2.5 *** Makefile 2001/09/11 13:18:36 1.23.2.4 --- Makefile 2001/11/08 19:13:47 1.23.2.5 *************** *** 21,24 **** --- 21,25 ---- DEFS+=-DUSE_OPENPTY #-DSETLOGIN_HOST #DEFS+=-DVERBOSE_DEBUG -DNO_FORK -DDEBUG_MALLOC + #DEFS+=-DREALLY_VERBOSE_DEBUGLOG prefix=/usr/local Index: clientsession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/clientsession.cc,v retrieving revision 1.23.2.3 retrieving revision 1.23.2.4 diff -C2 -r1.23.2.3 -r1.23.2.4 *** clientsession.cc 2001/09/11 13:18:36 1.23.2.3 --- clientsession.cc 2001/11/08 19:13:47 1.23.2.4 *************** *** 36,40 **** #include "lat_messages.h" ! ClientSession::ClientSession(class LATConnection &p, unsigned char remid, unsigned char localid, char *ttyname, bool clean): --- 36,40 ---- #include "lat_messages.h" ! ClientSession::ClientSession(class LATConnection &p, unsigned char remid, unsigned char localid, char *ttyname, bool clean): *************** *** 49,53 **** // This should never be called now as it is overridden // by all self-respecting superclasses. ! int ClientSession::new_session(unsigned char *_remote_node, char *service, char *port, unsigned char c) --- 49,53 ---- // This should never be called now as it is overridden // by all self-respecting superclasses. ! int ClientSession::new_session(unsigned char *_remote_node, char *service, char *port, unsigned char c) *************** *** 70,75 **** &slave_fd, NULL, NULL, NULL) != 0) return -1; /* REJECT */ - // Set terminal characteristics struct termios tio; --- 70,75 ---- &slave_fd, NULL, NULL, NULL) != 0) return -1; /* REJECT */ + // Set terminal characteristics struct termios tio; *************** *** 83,87 **** state = NEW; slave_fd_open = true; ! // Check for /dev/lat & create it if necessary struct stat st; --- 83,87 ---- state = NEW; slave_fd_open = true; ! // Check for /dev/lat & create it if necessary struct stat st; *************** *** 134,142 **** LAT_SessionData *reply = (LAT_SessionData *)buf; int ptr = sizeof(LAT_SessionData); ! buf[ptr++] = 0x01; // Service Class buf[ptr++] = 0x01; // Max Attention slot size.. buf[ptr++] = 0xfe; // Max Data slot size ! add_string(buf, &ptr, (unsigned char *)remote_service); buf[ptr++] = 0x00; // Source service length/name --- 134,142 ---- LAT_SessionData *reply = (LAT_SessionData *)buf; int ptr = sizeof(LAT_SessionData); ! buf[ptr++] = 0x01; // Service Class buf[ptr++] = 0x01; // Max Attention slot size.. buf[ptr++] = 0xfe; // Max Data slot size ! add_string(buf, &ptr, (unsigned char *)remote_service); buf[ptr++] = 0x00; // Source service length/name *************** *** 145,154 **** buf[ptr++] = 0x02; // Param Length 2 buf[ptr++] = 0x04; // Value 1024 ! buf[ptr++] = 0x00; // buf[ptr++] = 0x05; // Param type 5 (Local PTY name) add_string(buf, &ptr, (unsigned char *)ltaname); ! // If the user wanted a particular port number then add it // into the message if (remote_port[0] != '\0') --- 145,154 ---- buf[ptr++] = 0x02; // Param Length 2 buf[ptr++] = 0x04; // Value 1024 ! buf[ptr++] = 0x00; // buf[ptr++] = 0x05; // Param type 5 (Local PTY name) add_string(buf, &ptr, (unsigned char *)ltaname); ! // If the user wanted a particular port number then add it // into the message if (remote_port[0] != '\0') *************** *** 158,162 **** buf[ptr++] = 0x00; // NUL terminated (??) } ! // Send message... reply->header.cmd = LAT_CCMD_SESSION; --- 158,162 ---- buf[ptr++] = 0x00; // NUL terminated (??) } ! // Send message... reply->header.cmd = LAT_CCMD_SESSION; *************** *** 177,189 **** connected = false; remote_session = 0; ! // Close it all down so the local side gets EOF unlink(ltaname); ! if (slave_fd_open) close (slave_fd); close (master_fd); LATServer::Instance()->set_fd_state(master_fd, true); LATServer::Instance()->remove_fd(master_fd); ! // Now open it all up again ready for a new connection new_session((unsigned char *)remote_node, remote_service, remote_port, 0); --- 177,189 ---- connected = false; remote_session = 0; ! // Close it all down so the local side gets EOF unlink(ltaname); ! if (slave_fd_open) close (slave_fd); close (master_fd); LATServer::Instance()->set_fd_state(master_fd, true); LATServer::Instance()->remove_fd(master_fd); ! // Now open it all up again ready for a new connection new_session((unsigned char *)remote_node, remote_service, remote_port, 0); *************** *** 195,199 **** { debuglog(("ClientSession::disconnect_session()\n")); ! // If the reason was some sort of error then send it to // the PTY if (reason > 1) --- 195,199 ---- { debuglog(("ClientSession::disconnect_session()\n")); ! // If the reason was some sort of error then send it to // the PTY if (reason > 1) *************** *** 211,217 **** ClientSession::~ClientSession() ! { if (slave_fd_open) close (slave_fd); ! if (master_fd > -1) { close (master_fd); --- 211,217 ---- ClientSession::~ClientSession() ! { if (slave_fd_open) close (slave_fd); ! if (master_fd > -1) { close (master_fd); *************** *** 228,232 **** { state = STARTING; ! // Disable reads on the PTY until we are connected (or it fails) LATServer::Instance()->set_fd_state(master_fd, true); --- 228,232 ---- { state = STARTING; ! // Disable reads on the PTY until we are connected (or it fails) LATServer::Instance()->set_fd_state(master_fd, true); *************** *** 277,281 **** slotbuf[slotptr++] = 0x13; // Stop input char XOFF slotbuf[slotptr++] = 0x11; // Start input char XON ! add_slot(buf, ptr, 0xaf, slotbuf, slotptr); credit--; --- 277,281 ---- slotbuf[slotptr++] = 0x13; // Stop input char XOFF slotbuf[slotptr++] = 0x11; // Start input char XON ! add_slot(buf, ptr, 0xaf, slotbuf, slotptr); credit--; *************** *** 286,290 **** } ! // Called from the slave connection - return the master fd so it can // can do I/O on it and close the slave so it gets EOF notification. int ClientSession::get_port_fd() --- 286,290 ---- } ! // Called from the slave connection - return the master fd so it can // can do I/O on it and close the slave so it gets EOF notification. int ClientSession::get_port_fd() *************** *** 294,298 **** } ! // Normal client sessions don't provide feedback on status (though maybe we // should check for other status types.... void ClientSession::show_status(unsigned char *node, LAT_StatusEntry *entry) --- 294,298 ---- } ! // Normal client sessions don't provide feedback on status (though maybe we // should check for other status types.... void ClientSession::show_status(unsigned char *node, LAT_StatusEntry *entry) Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.31.2.10 retrieving revision 1.31.2.11 diff -C2 -r1.31.2.10 -r1.31.2.11 *** connection.cc 2001/09/11 13:18:36 1.31.2.10 --- connection.cc 2001/11/08 19:13:47 1.31.2.11 *************** *** 64,68 **** debuglog(("New connection: (c: %x, s: %x)\n", last_sequence_number, last_ack_number)); ! get_string(buf, &ptr, servicename); // This is actually local nodename get_string(buf, &ptr, remnode); --- 64,68 ---- debuglog(("New connection: (c: %x, s: %x)\n", last_sequence_number, last_ack_number)); ! get_string(buf, &ptr, servicename); // This is actually local nodename [...997 lines suppressed...] if (ptr >= len) return false; --- 1020,1024 ---- { int ptr = sizeof(LAT_SessionCmd)+3; ! ptr += buf[ptr]+1; // Skip over destination service if (ptr >= len) return false; *************** *** 1026,1030 **** unsigned int i; int num = 0; ! for (i=1; i<=highest_session; i++) if (sessions[i]) num++; --- 1058,1062 ---- unsigned int i; int num = 0; ! for (i=1; i<=highest_session; i++) if (sessions[i]) num++; Index: connection.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.h,v retrieving revision 1.16.2.6 retrieving revision 1.16.2.7 diff -C2 -r1.16.2.6 -r1.16.2.7 *** connection.h 2001/09/11 13:18:36 1.16.2.6 --- connection.h 2001/11/08 19:13:47 1.16.2.7 *************** *** 30,33 **** --- 30,34 ---- int send_message(unsigned char *, int, send_type); int queue_message(unsigned char *, int); + int add_data_slots(int start_slot, LAT_SlotCmd *slots[4]); void send_slot_message(unsigned char *, int); void circuit_timer(); Index: localport.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/Attic/localport.cc,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -r1.1.2.1 -r1.1.2.2 *** localport.cc 2001/09/11 13:18:36 1.1.2.1 --- localport.cc 2001/11/08 19:13:47 1.1.2.2 *************** *** 53,57 **** LocalPort::LocalPort(const LocalPort &p) { - fprintf(stderr, "LocalPort Copy Constructor\n"); service = p.service; portname = p.portname; --- 53,56 ---- *************** *** 82,85 **** --- 81,88 ---- tcgetattr(master_fd, &tio); tio.c_iflag |= IGNBRK|BRKINT; + tio.c_oflag &= ~ONLCR; + tio.c_oflag &= ~OCRNL; + tio.c_iflag &= ~INLCR; + tio.c_iflag &= ~ICRNL; tcsetattr(master_fd, TCSANOW, &tio); Index: localportsession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/Attic/localportsession.cc,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -r1.1.2.1 -r1.1.2.2 *** localportsession.cc 2001/09/11 13:18:36 1.1.2.1 --- localportsession.cc 2001/11/08 19:13:47 1.1.2.2 *************** *** 16,19 **** --- 16,20 ---- #include <sys/stat.h> #include <stdio.h> + #include <syslog.h> #include <fcntl.h> #include <unistd.h> *************** *** 42,48 **** char *lta, int fd): lloginSession(p, remid, localid, lta, clean), ! localport(port) { ! master_fd = fd; debuglog(("new localport session: localid %d, remote id %d\n", --- 43,51 ---- char *lta, int fd): lloginSession(p, remid, localid, lta, clean), ! localport(port), ! minimum_read(0), ! ignored_read(false) { ! master_fd = fd; debuglog(("new localport session: localid %d, remote id %d\n", *************** *** 65,67 **** --- 68,88 ---- debuglog(("Restarting PTY for local session\n")); localport->restart_pty(); + } + + void localportSession::do_read() + { + // If there are less than "minimum_read" bytes available then + // wait until the next time around. We never leave it for more + // than one timer tick though. + int numbytes; + ioctl(master_fd, FIONREAD, &numbytes); + if (numbytes < minimum_read && !ignored_read) + { + ignored_read = true; + } + else + { + read_pty(); + ignored_read = false; + } } Index: localportsession.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/Attic/localportsession.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -r1.1.2.1 -r1.1.2.2 *** localportsession.h 2001/09/11 13:18:36 1.1.2.1 --- localportsession.h 2001/11/08 19:13:47 1.1.2.2 *************** *** 20,26 **** virtual ~localportSession(); ! private: LocalPort *localport; }; --- 20,30 ---- virtual ~localportSession(); ! virtual void do_read(); ! private: LocalPort *localport; + + int minimum_read; + bool ignored_read; }; Index: session.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/session.cc,v retrieving revision 1.28.2.3 retrieving revision 1.28.2.4 diff -C2 -r1.28.2.3 -r1.28.2.4 *** session.cc 2001/09/11 13:18:36 1.28.2.3 --- session.cc 2001/11/08 19:13:47 1.28.2.4 *************** *** 51,55 **** void LATSession::add_credit(signed short c) { ! if (credit < 0) { debuglog(("ARGGHH: credit is negative\n")); --- 51,55 ---- void LATSession::add_credit(signed short c) { ! if (credit < 0) { debuglog(("ARGGHH: credit is negative\n")); *************** *** 57,61 **** } credit += c; ! if (stopped && credit) { --- 57,61 ---- } credit += c; ! if (stopped && credit) { *************** *** 63,66 **** --- 63,67 ---- stopped = false; LATServer::Instance()->set_fd_state(master_fd, false); + tcflow(master_fd, TCOON); } } *************** *** 68,76 **** /* Got some data from the terminal - send it to the PTY */ int LATSession::send_data_to_process(unsigned char *buf, int len) ! { // If there's anything to send, do so if (len) { ! #ifdef REALLY_VERBOSE_DEBUGLOG char debugbuf[1024]; memcpy(debugbuf, buf, len); --- 69,77 ---- /* Got some data from the terminal - send it to the PTY */ int LATSession::send_data_to_process(unsigned char *buf, int len) ! { // If there's anything to send, do so if (len) { ! #ifdef REALLY_VERBOSE_DEBUGLOG char debugbuf[1024]; memcpy(debugbuf, buf, len); *************** *** 118,122 **** int msglen; ! if (credit <= 0) { // Disable the FD so we don't start looping --- 119,123 ---- int msglen; ! if (credit <= 0) { // Disable the FD so we don't start looping *************** *** 125,132 **** return 0; // Not allowed! } - msglen = read(master_fd, buf, max_read_size); ! #ifdef REALLY_VERBOSE_DEBUGLOG if (msglen > 0) { --- 126,132 ---- return 0; // Not allowed! } msglen = read(master_fd, buf, max_read_size); ! #ifdef REALLY_VERBOSE_DEBUGLOG if (msglen > 0) { *************** *** 134,138 **** char tmp = buf[10]; buf[10] = '\0'; // Just a sample ! debuglog(("Session %d From PTY(%d): '%s%s'\n", local_session, msglen, buf, (msglen>10)?"...":"")); buf[10] = tmp; --- 134,138 ---- char tmp = buf[10]; buf[10] = '\0'; // Just a sample ! debuglog(("Session %d From PTY(%d): '%s%s'\n", local_session, msglen, buf, (msglen>10)?"...":"")); buf[10] = tmp; *************** *** 144,148 **** { if (msglen < 0 && errno == EAGAIN) return 0; // Just no data. ! debuglog(("EOF on PTY\n")); unsigned char slotbuf[5]; --- 144,148 ---- { if (msglen < 0 && errno == EAGAIN) return 0; // Just no data. ! debuglog(("EOF on PTY\n")); unsigned char slotbuf[5]; *************** *** 153,159 **** add_slot(buf, ptr, 0xb0, slotbuf, 1); ! // Tru64 (and DS500 I think) don't like the // local session ID to be set on the final disconnect slot ! int s=local_session; local_session=0; --- 153,159 ---- add_slot(buf, ptr, 0xb0, slotbuf, 1); ! // Tru64 (and DS500 I think) don't like the // local session ID to be set on the final disconnect slot ! int s=local_session; local_session=0; *************** *** 164,168 **** // before the circuit timer goes off. parent.send_message(buf, ptr, LATConnection::DATA); ! disconnect_session(1); // User requested return 0; --- 164,168 ---- // before the circuit timer goes off. parent.send_message(buf, ptr, LATConnection::DATA); ! disconnect_session(1); // User requested return 0; *************** *** 218,222 **** command |= 0x5; } ! // Send response... header->remote_session = local_session; --- 218,222 ---- command |= 0x5; } ! // Send response... header->remote_session = local_session; *************** *** 229,233 **** parent.send_slot_message(reply, ptr+msglen); ! // Have we now run out of credit ?? if (--credit <= 0) --- 229,233 ---- parent.send_slot_message(reply, ptr+msglen); ! // Have we now run out of credit ?? if (--credit <= 0) *************** *** 236,239 **** --- 236,240 ---- debuglog(("Out of credit...Stop\n")); stopped = true; + tcflow(master_fd, TCOOFF); } return 0; *************** *** 258,262 **** debuglog(("Sending DISABLED message\n")); ! reply->header.cmd = LAT_CCMD_SREPLY; reply->header.num_slots = 1; --- 259,263 ---- debuglog(("Sending DISABLED message\n")); ! reply->header.cmd = LAT_CCMD_SREPLY; reply->header.num_slots = 1; *************** *** 266,270 **** reply->slot.cmd = 0xc8; // Disconnect session. ! parent.send_message(replybuf, sizeof(LAT_SessionReply), LATConnection::REPLY); } --- 267,271 ---- reply->slot.cmd = 0xc8; // Disconnect session. ! parent.send_message(replybuf, sizeof(LAT_SessionReply), LATConnection::REPLY); } *************** *** 302,310 **** unsigned char *issue = new unsigned char[255]; unsigned char *newissue = new unsigned char[255]; ! size_t len = read(f, issue, 255); close(f); ! ! size_t newlen = 0; if (len > 255) len = 255; --- 303,311 ---- unsigned char *issue = new unsigned char[255]; unsigned char *newissue = new unsigned char[255]; ! size_t len = read(f, issue, 255); close(f); ! ! size_t newlen = 0; if (len > 255) len = 255; *************** *** 320,325 **** newissue[newlen++] = issue[i++]; ! } ! echo_expected = false; --- 321,326 ---- newissue[newlen++] = issue[i++]; ! } ! echo_expected = false; *************** *** 342,356 **** // Add a slot to an existing message ! void LATSession::add_slot(unsigned char *buf, int &ptr, int slotcmd, unsigned char *slotdata, int len) { // Allow the caller to initialize ptr to zero and we will do the rest ! if (ptr == 0) { ptr = sizeof(LAT_Header); LAT_Header *h = (LAT_Header *)buf; ! h->num_slots = 0; } ! // Write the slot header LAT_SlotCmd *slot = (LAT_SlotCmd *)(buf+ptr); --- 343,357 ---- // Add a slot to an existing message ! void LATSession::add_slot(unsigned char *buf, int &ptr, int slotcmd, unsigned char *slotdata, int len) { // Allow the caller to initialize ptr to zero and we will do the rest ! if (ptr == 0) { ptr = sizeof(LAT_Header); LAT_Header *h = (LAT_Header *)buf; ! h->num_slots = 0; } ! // Write the slot header LAT_SlotCmd *slot = (LAT_SlotCmd *)(buf+ptr); *************** *** 360,371 **** slot->remote_session = local_session; slot->local_session = remote_session; - // Copy the data memcpy(buf+ptr, slotdata, len); ptr += len; if (ptr%2) ptr++; // Word aligned - // Increment the number of slots. LAT_Header *header = (LAT_Header *)buf; --- 361,372 ---- slot->remote_session = local_session; slot->local_session = remote_session; + // Copy the data memcpy(buf+ptr, slotdata, len); ptr += len; if (ptr%2) ptr++; // Word aligned + // Increment the number of slots. LAT_Header *header = (LAT_Header *)buf; *************** *** 377,381 **** } ! void LATSession::crlf_to_lf(unsigned char *buf, int len, unsigned char *newbuf, int *newlen) { --- 378,382 ---- } ! void LATSession::crlf_to_lf(unsigned char *buf, int len, unsigned char *newbuf, int *newlen) { *************** *** 387,391 **** for (i=0; i<len; i++) { ! if (i>0 && i<len && (buf[i] == '\r') && (buf[i-1] == '\n')) { continue; --- 388,392 ---- for (i=0; i<len; i++) { ! if (i>0 && i<len && (buf[i] == '\r') && (buf[i-1] == '\n')) { continue; |
From: Patrick C. <pa...@us...> - 2001-11-05 10:11:06
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory usw-pr-cvs1:/tmp/cvs-serv24062 Modified Files: control libdnet.postinst Log Message: Fix some lintian warnings. Index: control =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/control,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** control 2001/06/19 10:49:43 1.16 --- control 2001/11/05 10:11:03 1.17 *************** *** 8,12 **** Package: dnet-common Architecture: all ! Depends: debconf, debianutils (>=1.13), mawk | awk Priority: extra Section: net --- 8,12 ---- Package: dnet-common Architecture: all ! Depends: debconf(>=0.5.00), debianutils (>=1.13), mawk | awk Priority: extra Section: net *************** *** 25,29 **** Package: dnet-progs Architecture: any ! Depends: ${shlibs:Depends}, libdnet(>=${Source-Version}) Priority: extra Section: net --- 25,29 ---- Package: dnet-progs Architecture: any ! Depends: ${shlibs:Depends} Priority: extra Section: net Index: libdnet.postinst =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/libdnet.postinst,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** libdnet.postinst 2001/11/05 08:56:22 1.3 --- libdnet.postinst 2001/11/05 10:11:03 1.4 *************** *** 3,12 **** set -e ! if [ "$1" = "configure" ] ! then ! ldconfig fi - - #DEBHELPER# --- 3,8 ---- set -e ! f [ "$1" = "configure" ]; then ldconfig fi #DEBHELPER# |
From: Patrick C. <pa...@us...> - 2001-11-05 08:56:25
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory usw-pr-cvs1:/tmp/cvs-serv5105 Modified Files: libdnet.postinst Log Message: Fix typo Index: libdnet.postinst =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/libdnet.postinst,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** libdnet.postinst 2001/09/26 09:02:31 1.2 --- libdnet.postinst 2001/11/05 08:56:22 1.3 *************** *** 3,7 **** set -e ! if [ "$1" == "configure" ] then ldconfig --- 3,7 ---- set -e ! if [ "$1" = "configure" ] then ldconfig *************** *** 10,12 **** ! #DEBHELPER# \ No newline at end of file --- 10,12 ---- ! #DEBHELPER# |
From: Patrick C. <pa...@us...> - 2001-11-04 17:46:39
|
Update of /cvsroot/linux-decnet/dnprogs/dncopy In directory usw-pr-cvs1:/tmp/cvs-serv4377 Modified Files: dnetfile_dap.cc Log Message: Return error if the only file we were asked to get was locked. Index: dnetfile_dap.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dnetfile_dap.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** dnetfile_dap.cc 2000/10/27 16:05:26 1.2 --- dnetfile_dap.cc 2001/11/04 17:46:36 1.3 *************** *** 1,5 **** /****************************************************************************** (c) 1998-1999 P.J. Caulfield pa...@ty... ! 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 --- 1,5 ---- /****************************************************************************** (c) 1998-1999 P.J. Caulfield pa...@ty... ! 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 *************** *** 62,66 **** DAPLOG((LOG_ERR, "dap_get_reply error: %s\n",conn.get_error())); ! return -1; } /*-------------------------------------------------------------------------*/ --- 62,66 ---- DAPLOG((LOG_ERR, "dap_get_reply error: %s\n",conn.get_error())); ! return -1; } /*-------------------------------------------------------------------------*/ *************** *** 92,96 **** dap_access_message::DISPLAY_NAME_MASK); acc.set_filespec(filname); ! return !acc.write(conn); } --- 92,96 ---- dap_access_message::DISPLAY_NAME_MASK); acc.set_filespec(filname); ! return !acc.write(conn); } *************** *** 131,135 **** } break; ! case dap_message::ACCOMP: return -2; // End of wildcard list --- 131,135 ---- } break; ! case dap_message::ACCOMP: return -2; // End of wildcard list *************** *** 139,143 **** dap_attrib_message *am =(dap_attrib_message *)m; *rfm = am->get_rfm(); ! *rat = am->get_rat(); file_fsz = am->get_fsz(); } --- 139,143 ---- dap_attrib_message *am =(dap_attrib_message *)m; *rfm = am->get_rfm(); ! *rat = am->get_rat(); file_fsz = am->get_fsz(); } *************** *** 156,160 **** { dap_status_message *sm = (dap_status_message *)m; ! if (sm->get_code() == 0x4030) // Locked { dap_send_skip(); --- 156,160 ---- { dap_status_message *sm = (dap_status_message *)m; ! if (wildcard && sm->get_code() == 0x4030) // Locked { dap_send_skip(); *************** *** 219,223 **** conn.set_blocked(false); //PJC ! if (writing) return dap_get_reply(); else --- 219,223 ---- conn.set_blocked(false); //PJC ! if (writing) return dap_get_reply(); else *************** *** 258,262 **** rec[len] = 0; memcpy(rec, dm->get_dataptr(), len); ! return len; } --- 258,262 ---- rec[len] = 0; memcpy(rec, dm->get_dataptr(), len); ! return len; } *************** *** 291,295 **** dap_attrib_message att; dap_alloc_message all; ! att.set_org(dap_attrib_message::FB$SEQ); --- 291,295 ---- dap_attrib_message att; dap_alloc_message all; ! att.set_org(dap_attrib_message::FB$SEQ); |
From: Patrick C. <pa...@us...> - 2001-10-31 09:54:17
|
Update of /cvsroot/linux-decnet/dnprogs/mail/uulib In directory usw-pr-cvs1:/tmp/cvs-serv4615 Modified Files: Makefile Log Message: Add -fsigned-char to compile options so it does the "right thing" on machines where "char" is unsigned by default. Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/mail/uulib/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** Makefile 2000/04/26 08:22:04 1.1.1.1 --- Makefile 2001/10/31 09:54:12 1.2 *************** *** 26,30 **** # C Compiler Options # ! CFLAGS = -O -I. -DHAVE_CONFIG_H # # the ranlib program --- 26,30 ---- # C Compiler Options # ! CFLAGS = -fsigned-char -O -I. -DHAVE_CONFIG_H # # the ranlib program |
From: Patrick C. <pa...@us...> - 2001-10-31 09:49:38
|
Update of /cvsroot/linux-decnet/dnprogs/librms In directory usw-pr-cvs1:/tmp/cvs-serv2435 Modified Files: getreply.cc Log Message: Need #include <stdarg.h> for hppa Index: getreply.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/librms/getreply.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** getreply.cc 2000/10/27 16:17:30 1.2 --- getreply.cc 2001/10/31 09:49:35 1.3 *************** *** 22,25 **** --- 22,26 ---- #include <stdlib.h> #include <stdio.h> + #include <stdarg.h> #include <string.h> #include <errno.h> |
From: Patrick C. <pa...@us...> - 2001-10-21 14:24:03
|
Update of /cvsroot/linux-decnet/dnprogs/mail In directory usw-pr-cvs1:/tmp/cvs-serv20903/mail Modified Files: sendvmsmail.c Log Message: Use cuserid rather than getlogin to get the username Index: sendvmsmail.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/mail/sendvmsmail.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** sendvmsmail.c 2000/10/27 16:17:30 1.2 --- sendvmsmail.c 2001/10/21 14:24:00 1.3 *************** *** 1,5 **** /****************************************************************************** (c) 1998-2000 P.J. Caulfield pa...@ty... ! 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 --- 1,5 ---- /****************************************************************************** (c) 1998-2000 P.J. Caulfield pa...@ty... ! 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 *************** *** 61,65 **** syslog(LOG_ERR, "running as %d\n", getuid()); ! // Get the relevant fields from the mail header if (parse_header(&to, &subject, &from, &reply_to) == 0) --- 61,65 ---- syslog(LOG_ERR, "running as %d\n", getuid()); ! // Get the relevant fields from the mail header if (parse_header(&to, &subject, &from, &reply_to) == 0) *************** *** 71,75 **** { char err[256]; ! sprintf(err, "Error sending to VMS system: %s\n", strerror(errno)); mail_error(reply_to, to, subject, err); --- 71,75 ---- { char err[256]; ! sprintf(err, "Error sending to VMS system: %s\n", strerror(errno)); mail_error(reply_to, to, subject, err); *************** *** 97,104 **** { fgets(input_line, sizeof(input_line), stdin); ! input_line[strlen(input_line)-1] = '\0'; // syslog(LOG_INFO, "line: %s\n", input_line); ! if (strncmp(input_line, "Subject: ", 9) == 0) { --- 97,104 ---- { fgets(input_line, sizeof(input_line), stdin); ! input_line[strlen(input_line)-1] = '\0'; // syslog(LOG_INFO, "line: %s\n", input_line); ! if (strncmp(input_line, "Subject: ", 9) == 0) { *************** *** 135,141 **** char *ptr; char *endline; ! ptr=strchr(input_line, '('); ! if (ptr) // probably 'vmsmail@pandh (tramp::patrick)' format { --- 135,141 ---- char *ptr; char *endline; ! ptr=strchr(input_line, '('); ! if (ptr) // probably 'vmsmail@pandh (tramp::patrick)' format { *************** *** 166,170 **** { int p; ! *ptr = '\0'; // Remove trailing spaces. --- 166,170 ---- { int p; ! *ptr = '\0'; // Remove trailing spaces. *************** *** 200,204 **** strcpy(*subject, "No subject"); } ! // Make sure we have all the bits if (error == NULL && (*to==NULL || *from==NULL || *subject==NULL || *real_from==NULL) ) --- 200,204 ---- strcpy(*subject, "No subject"); } ! // Make sure we have all the bits if (error == NULL && (*to==NULL || *from==NULL || *subject==NULL || *real_from==NULL) ) *************** *** 206,210 **** error="The message header was incomplete"; } ! if (error) { --- 206,210 ---- error="The message header was incomplete"; } ! if (error) { *************** *** 212,216 **** return -1; } ! return 0; } --- 212,216 ---- return -1; } ! return 0; } *************** *** 223,227 **** char buf[256]; FILE *mailpipe; ! // Open a pipe to sendmail. sprintf(buf, "%s", SENDMAIL_COMMAND); --- 223,227 ---- char buf[256]; FILE *mailpipe; ! // Open a pipe to sendmail. sprintf(buf, "%s", SENDMAIL_COMMAND); *************** *** 235,239 **** fprintf(mailpipe, "\n"); ! fprintf(mailpipe, "Your message to '%s' could not be delivered to\n", name); fprintf(mailpipe, "VMS because of the following error:\n"); --- 235,239 ---- fprintf(mailpipe, "\n"); ! fprintf(mailpipe, "Your message to '%s' could not be delivered to\n", name); fprintf(mailpipe, "VMS because of the following error:\n"); *************** *** 264,269 **** struct sockaddr_dn sockaddr; struct accessdata_dn accessdata; ! ! if ((sockfd=socket(AF_DECnet,SOCK_SEQPACKET,DNPROTO_NSP)) == -1) { return -1; --- 264,269 ---- struct sockaddr_dn sockaddr; struct accessdata_dn accessdata; ! ! if ((sockfd=socket(AF_DECnet,SOCK_SEQPACKET,DNPROTO_NSP)) == -1) { return -1; *************** *** 277,283 **** memset(&accessdata, 0, sizeof(accessdata)); ! // Try very hard to get the local username ! local_user = getlogin(); if (!local_user || local_user == (char *)0xffffffff) local_user = getenv("LOGNAME"); --- 277,283 ---- memset(&accessdata, 0, sizeof(accessdata)); ! // Try very hard to get the local username ! local_user = cuserid(NULL); if (!local_user || local_user == (char *)0xffffffff) local_user = getenv("LOGNAME"); *************** *** 285,289 **** if (local_user) { ! strcpy((char *)accessdata.acc_acc, local_user); accessdata.acc_accl = strlen((char *)accessdata.acc_acc); --- 285,289 ---- if (local_user) { ! strcpy((char *)accessdata.acc_acc, local_user); accessdata.acc_accl = strlen((char *)accessdata.acc_acc); *************** *** 291,295 **** accessdata.acc_acc[i] = toupper(accessdata.acc_acc[i]); } ! if (setsockopt(sockfd,DNPROTO_NSP,SO_CONACCESS,&accessdata, sizeof(accessdata)) < 0) --- 291,295 ---- accessdata.acc_acc[i] = toupper(accessdata.acc_acc[i]); } ! if (setsockopt(sockfd,DNPROTO_NSP,SO_CONACCESS,&accessdata, sizeof(accessdata)) < 0) *************** *** 303,313 **** sockaddr.sdn_add.a_len = 0x02; memcpy(sockaddr.sdn_add.a_addr, np->n_addr,2); ! ! if (connect(sockfd, (struct sockaddr *)&sockaddr, ! sizeof(sockaddr)) < 0) { return -1; } ! return sockfd; } --- 303,313 ---- sockaddr.sdn_add.a_len = 0x02; memcpy(sockaddr.sdn_add.a_addr, np->n_addr,2); ! ! if (connect(sockfd, (struct sockaddr *)&sockaddr, ! sizeof(sockaddr)) < 0) { return -1; } ! return sockfd; } *************** *** 341,351 **** // Local user -- VMS add nodename:: if (write(sockfd, from, strlen(from)) < 0) return -1; ! vmsuser = strchr(to, ':') + 2; // VMS user if (write(sockfd, vmsuser, strlen(vmsuser)) < 0) return -1; ! recvlen = read(sockfd, recvbuf, sizeof(recvbuf)); if (recvlen < 0) return -1; ! // Check for error - most likely an unknown user if (recvbuf[0] != '\001') --- 341,351 ---- // Local user -- VMS add nodename:: if (write(sockfd, from, strlen(from)) < 0) return -1; ! vmsuser = strchr(to, ':') + 2; // VMS user if (write(sockfd, vmsuser, strlen(vmsuser)) < 0) return -1; ! recvlen = read(sockfd, recvbuf, sizeof(recvbuf)); if (recvlen < 0) return -1; ! // Check for error - most likely an unknown user if (recvbuf[0] != '\001') *************** *** 353,357 **** if (recvlen == 4) // Get the message text recvlen = read(sockfd, recvbuf, sizeof(recvbuf)); ! if (recvlen < 0) return -1; recvbuf[recvlen] = '\0'; --- 353,357 ---- if (recvlen == 4) // Get the message text recvlen = read(sockfd, recvbuf, sizeof(recvbuf)); ! if (recvlen < 0) return -1; recvbuf[recvlen] = '\0'; *************** *** 361,365 **** return 0; } ! if (write(sockfd, "\0", 1) < 0) return -1; if (write(sockfd, to, strlen(to)) < 0) return -1; --- 361,365 ---- return 0; } ! if (write(sockfd, "\0", 1) < 0) return -1; if (write(sockfd, to, strlen(to)) < 0) return -1; *************** *** 397,403 **** if (recvlen < 0) return -1; recvbuf[recvlen] = '\0'; ! syslog(LOG_ERR, "Error returned from VMS after sending message: %s\n", recvbuf); ! mail_error(reply_to, to, subject, recvbuf); return 0; --- 397,403 ---- if (recvlen < 0) return -1; recvbuf[recvlen] = '\0'; ! syslog(LOG_ERR, "Error returned from VMS after sending message: %s\n", recvbuf); ! mail_error(reply_to, to, subject, recvbuf); return 0; |
From: Patrick C. <pa...@us...> - 2001-10-21 14:24:03
|
Update of /cvsroot/linux-decnet/dnprogs/libdnet In directory usw-pr-cvs1:/tmp/cvs-serv20903/libdnet Modified Files: dnet_conn.c Log Message: Use cuserid rather than getlogin to get the username Index: dnet_conn.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/libdnet/dnet_conn.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** dnet_conn.c 2001/08/09 08:26:40 1.6 --- dnet_conn.c 2001/10/21 14:24:00 1.7 *************** *** 103,107 **** */ if (uid == 0) { ! char *tname = getlogin(); char *uname = (tname && *tname) ? tname : "anonymous"; int len = strlen(uname); --- 103,107 ---- */ if (uid == 0) { ! char *tname = cuserid(NULL); char *uname = (tname && *tname) ? tname : "anonymous"; int len = strlen(uname); |
From: Patrick C. <pa...@us...> - 2001-10-21 14:24:03
|
Update of /cvsroot/linux-decnet/dnprogs/librms In directory usw-pr-cvs1:/tmp/cvs-serv20903/librms Modified Files: example.c Log Message: Use cuserid rather than getlogin to get the username Index: example.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/librms/example.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** example.c 2000/04/26 08:22:04 1.1.1.1 --- example.c 2001/10/21 14:24:00 1.2 *************** *** 14,18 **** { /* Open the file. Keep the RMSHANDLE returned */ ! RMSHANDLE h = rms_open("marsha::index.dat", O_RDWR, NULL); if (h) { --- 14,21 ---- { /* Open the file. Keep the RMSHANDLE returned */ ! RMSHANDLE h; ! ! h = rms_open("ford::index.dat", O_RDWR, NULL); ! if (h) { |
From: Patrick C. <pa...@us...> - 2001-10-21 14:24:03
|
Update of /cvsroot/linux-decnet/dnprogs/dntask In directory usw-pr-cvs1:/tmp/cvs-serv20903/dntask Modified Files: dntask.c Log Message: Use cuserid rather than getlogin to get the username Index: dntask.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dntask/dntask.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** dntask.c 2001/03/14 19:06:18 1.4 --- dntask.c 2001/10/21 14:24:00 1.5 *************** *** 2,6 **** (c) 1998 P.J. Caulfield pa...@ty... K. Humborg ke...@av... ! 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 --- 2,6 ---- (c) 1998 P.J. Caulfield pa...@ty... K. Humborg ke...@av... ! 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 *************** *** 73,77 **** tv.tv_usec = 0; ! /* Loop for input */ while ( select(sockfd+1, &in, NULL, NULL, (timeout==0?NULL:&tv)) > 0) { --- 73,77 ---- tv.tv_usec = 0; ! /* Loop for input */ while ( select(sockfd+1, &in, NULL, NULL, (timeout==0?NULL:&tv)) > 0) { *************** *** 104,112 **** return; } ! if (len == 0) return; //EOF if (buf[len-1] == '\n') buf[--len] = '\0'; write(sockfd, buf, len); } ! // Reset for another select FD_ZERO(&in); --- 104,112 ---- return; } ! if (len == 0) return; //EOF if (buf[len-1] == '\n') buf[--len] = '\0'; write(sockfd, buf, len); } ! // Reset for another select FD_ZERO(&in); *************** *** 125,129 **** { int len; ! while ( ((len = read(sockfd, buf, sizeof(buf)))) ) { --- 125,129 ---- { int len; ! while ( ((len = read(sockfd, buf, sizeof(buf)))) ) { *************** *** 133,137 **** break; } ! if (binary_mode) { --- 133,137 ---- break; } ! if (binary_mode) { *************** *** 165,169 **** } ! if ((sockfd=socket(AF_DECnet,SOCK_SEQPACKET,DNPROTO_NSP)) == -1) { perror("socket"); --- 165,169 ---- } ! if ((sockfd=socket(AF_DECnet,SOCK_SEQPACKET,DNPROTO_NSP)) == -1) { perror("socket"); *************** *** 179,183 **** // Provide access control and proxy information if (setsockopt(sockfd,DNPROTO_NSP,SO_CONACCESS,&accessdata, ! sizeof(accessdata)) < 0) { perror("setsockopt"); --- 179,183 ---- // Provide access control and proxy information if (setsockopt(sockfd,DNPROTO_NSP,SO_CONACCESS,&accessdata, ! sizeof(accessdata)) < 0) { perror("setsockopt"); *************** *** 199,204 **** sockaddr.sdn_add.a_len = 2; ! ! if (connect(sockfd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) { perror("connect"); --- 199,204 ---- sockaddr.sdn_add.a_len = 2; ! ! if (connect(sockfd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) { perror("connect"); *************** *** 231,235 **** switch(opt) { ! case 'h': usage(stdout); exit(1); --- 231,235 ---- switch(opt) { ! case 'h': usage(stdout); exit(1); *************** *** 238,250 **** usage(stderr); exit(1); ! case 'i': interactive = 1; break; ! case 't': timeout = atoi(optarg); break; ! case 'V': printf("\ndntask from dntools version %s\n\n", VERSION); --- 238,250 ---- usage(stderr); exit(1); ! case 'i': interactive = 1; break; ! case 't': timeout = atoi(optarg); break; ! case 'V': printf("\ndntask from dntools version %s\n\n", VERSION); *************** *** 262,266 **** exit(1); } ! /* Parse the command into its parts */ if (!parse(argv[optind])) --- 262,266 ---- exit(1); } ! /* Parse the command into its parts */ if (!parse(argv[optind])) *************** *** 277,281 **** else be_interactive(); ! close(sockfd); return 0; --- 277,281 ---- else be_interactive(); ! close(sockfd); return 0; *************** *** 291,295 **** int n1=0; char *local_user; ! state = NODE; /* Node is mandatory */ --- 291,295 ---- int n1=0; char *local_user; ! state = NODE; /* Node is mandatory */ *************** *** 301,305 **** if (fname[n0] != ':' && fname[n0] != '\"' && fname[n0] != '\'') { ! if (n1 >= MAX_NODE || fname[n0] == ' ' || fname[n0] == '\n') { --- 301,305 ---- if (fname[n0] != ':' && fname[n0] != '\"' && fname[n0] != '\'') { ! if (n1 >= MAX_NODE || fname[n0] == ' ' || fname[n0] == '\n') { *************** *** 421,425 **** // Try very hard to get the local username ! local_user = getlogin(); if (!local_user || local_user == (char *)0xffffffff) local_user = getenv("LOGNAME"); --- 421,425 ---- // Try very hard to get the local username ! local_user = cuserid(NULL); if (!local_user || local_user == (char *)0xffffffff) local_user = getenv("LOGNAME"); *************** *** 439,446 **** ! /* If the password is "-" and fd 0 is a tty then prompt for a password */ if (accessdata.acc_pass[0] == '-' && accessdata.acc_pass[1] == '\0' && isatty(0)) ! { char *password = getpass("Password: "); if (password == NULL || strlen(password) > (unsigned int)MAX_PASSWORD) --- 439,446 ---- ! /* If the password is "-" and fd 0 is a tty then prompt for a password */ if (accessdata.acc_pass[0] == '-' && accessdata.acc_pass[1] == '\0' && isatty(0)) ! { char *password = getpass("Password: "); if (password == NULL || strlen(password) > (unsigned int)MAX_PASSWORD) *************** *** 451,456 **** strcpy(accessdata.acc_pass, password); } - /* Complete the accessdata structure */ accessdata.acc_userl = strlen(accessdata.acc_user); --- 451,456 ---- strcpy(accessdata.acc_pass, password); } + /* Complete the accessdata structure */ accessdata.acc_userl = strlen(accessdata.acc_user); |