linux-decnet-commit Mailing List for DECnet for Linux (Page 20)
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...> - 2006-03-29 10:21:05
|
Update of /cvsroot/linux-decnet/dnprogs/multinet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13742 Modified Files: multinet.c Log Message: Make things into cmdline options Index: multinet.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/multinet/multinet.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** multinet.c 29 Mar 2006 09:01:15 -0000 1.3 --- multinet.c 29 Mar 2006 10:20:57 -0000 1.4 *************** *** 35,40 **** #include <netinet/in.h> #include <fcntl.h> #include <string.h> - #include <termios.h> #include <netdb.h> #include <sys/socket.h> --- 35,40 ---- #include <netinet/in.h> #include <fcntl.h> + #include <getopt.h> #include <string.h> #include <netdb.h> #include <sys/socket.h> *************** *** 52,56 **** static int got_verification; ! #define PORT 700 #define DUMP_MAX 1024 --- 52,60 ---- static int got_verification; ! static int router_priority = 64; ! static int router_level = 2; ! static int mtu = 578; ! static int port = 700; ! #define DUMP_MAX 1024 *************** *** 101,105 **** memset(header, 0, sizeof(header)); ! // Add ethernet header header[0] = 0xAA; header[1] = 0x00; --- 105,109 ---- memset(header, 0, sizeof(header)); ! /* Add ethernet header */ header[0] = 0xAA; header[1] = 0x00; *************** *** 111,121 **** if (mcast) /* Routing multicast - type may need to be in callers params */ { ! header[6] = 0x09; ! header[7] = 0x00; ! header[8] = 0x00; ! header[9] = 0x00; ! header[10] = 0x09; ! header[11] = 0x23; header_len = 14; } else --- 115,128 ---- if (mcast) /* Routing multicast - type may need to be in callers params */ { ! header[6] = 0xab; ! header[7] = 0x00; ! header[8] = 0x00; ! header[9] = 0x03; ! header[10] = 0x00; ! header[11] = 0x00; ! header_len = 14; + // TODO Maybe want to send to 09:00:2b:02:00:00 too, + // Not sure why VMS sends to both, probably backward compatibility } else *************** *** 127,130 **** --- 134,138 ---- header[10] = remote_decnet_addr[0]; header[11] = remote_decnet_addr[1]; + header_len = sizeof(header); } *************** *** 146,152 **** header[22] = header[30] = 0x04; header[23] = header[31] = 0x00; ! header[24] = buf[1]; // Dest addr header[25] = buf[2]; ! header[32] = buf[3]; // src addr header[33] = buf[4]; --- 154,160 ---- header[22] = header[30] = 0x04; header[23] = header[31] = 0x00; ! header[24] = buf[1]; /* Dest addr */ header[25] = buf[2]; ! header[32] = buf[3]; /* src addr */ header[33] = buf[4]; *************** *** 183,190 **** { /* Shorten DECnet addresses */ ! buf[0] = 0x02; // TODO what is this ?? ! buf[1] = buf[8]; // Destination buf[2] = buf[9]; ! buf[3] = buf[16]; // Source buf[4] = buf[17]; buf[5] = 0; --- 191,198 ---- { /* Shorten DECnet addresses */ ! buf[0] = 0x02; // TODO what is this ?? ! buf[1] = buf[8]; /* Destination */ buf[2] = buf[9]; ! buf[3] = buf[16]; /* Source */ buf[4] = buf[17]; buf[5] = 0; *************** *** 204,208 **** msg.msg_namelen = sizeof(struct sockaddr_in); ! // dump_data("Send to IP0", header, sizeof(header)); dump_data("Send to IP1:", buf, len); --- 212,216 ---- msg.msg_namelen = sizeof(struct sockaddr_in); ! dump_data("Send to IP0", header, sizeof(header)); dump_data("Send to IP1:", buf, len); *************** *** 257,269 **** dump_data("from IP:", buf, len); ! if (buf[4] == 0x05) { ! // TODO what's this second MAC address????? 3.35 (in this packet) unsigned char hello[] = {/* Router 2 hello message */ ! 0x22, 0x00, 0x0b, 0x02, 0x00, 0x00, 0xaa, 0x00, 0x04, 0x00, buf[5], buf[6], 0x02, 0xda, 0x05, 0x40, ! 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xaa, 0x00, 0x04, ! 0x00, 0x02, 0x2c, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; ! send_tun(1, hello, sizeof(hello)); // Should go to multicst ab-00-00-04-00-00, got_verification = 1; --- 265,287 ---- dump_data("from IP:", buf, len); ! if (buf[4] == 0x05) /* PtP hello */ { ! // TODO get router priority & level from /proc */ unsigned char hello[] = {/* Router 2 hello message */ ! 0x00, 0x00, /* Length, filled in later */ ! 0x0b, /* FLAGS: Router hello */ ! 0x02, 0x00, 0x00, /* Router version */ ! 0xaa, 0x00, 0x04, 0x00, buf[5], buf[6], /* Routers MAC addr */ ! router_level, /* Info, including routing level */ ! mtu % 0xFF, mtu >> 8, /* Data block size */ ! 0x40, /* Priority */ ! 0x00, /* Reserved */ ! 0x0f, 0x00, /* Hello timer (seconds) */ ! 0x00, /* Reserved */ ! 0x00, /* Length of (other 'logical' ethernets) message that follows */ ! }; ! hello[0] = sizeof(hello); /* Allow me to edit it at will */ ! send_tun(1, hello, sizeof(hello)); got_verification = 1; *************** *** 283,295 **** printf("Remote address = %d.%d (%d)\n", addr>>10, addr&1023, addr); } - return; } if (buf[4] == 0x03) // TODO check this return; ! if (buf[4] == 0x02) // TODO check this ! return; ! if (buf[4] == 0x07) /* Routing info */ { /* --- 301,314 ---- printf("Remote address = %d.%d (%d)\n", addr>>10, addr&1023, addr); } return; } if (buf[4] == 0x03) // TODO check this + { + if (verbose) + fprintf(stderr, "Discarding 0x03 message\n"); return; ! } ! if (buf[4] == 0x07) /* Routing info */ // TODO Fix this ! { /* *************** *** 335,339 **** if (len <= 0) return; ! /* Only send DECnet packets... */ if (buf[12] == 0x60 && buf[13] == 0x03) { --- 354,358 ---- if (len <= 0) return; ! /* Only forward DECnet packets... */ if (buf[12] == 0x60 && buf[13] == 0x03) { *************** *** 349,353 **** } ! if (buf[16] == 0x0d) // Ethernet Hello, (TODO check routing ones too ?) { unsigned char ptp_hello[] = { 0x5, buf[10], buf[11], 0252, 0252, 0252, 0252}; --- 368,374 ---- } ! /* Ethernet endnode or router hello, ! we replace these with PtP hello messages */ ! if (buf[16] == 0x0d || buf[16] == 0x0b) { unsigned char ptp_hello[] = { 0x5, buf[10], buf[11], 0252, 0252, 0252, 0252}; *************** *** 358,361 **** --- 379,383 ---- } + /* Data or other packet */ send_ip(1, buf+16, len-16); } *************** *** 367,370 **** --- 389,393 ---- struct ifreq ifr; char cmd[132]; + FILE *procfile; tunfd = open("/dev/net/tun", O_RDWR); *************** *** 385,394 **** fprintf(stderr, "using tun device %s\n", ifr.ifr_name); ! sprintf(cmd, "/sbin/ifconfig %s hw ether AA:00:04:00:%02X:%02X allmulti mtu 576 up\n", ifr.ifr_name, addr & 0xFF, addr>>8); system(cmd); return tunfd; } int main(int argc, char *argv[]) { --- 408,458 ---- fprintf(stderr, "using tun device %s\n", ifr.ifr_name); ! sprintf(cmd, "/sbin/ifconfig %s hw ether AA:00:04:00:%02X:%02X allmulti mtu %d up\n", ! ifr.ifr_name, addr & 0xFF, addr>>8, mtu); system(cmd); + sprintf(cmd, "/proc/sys/net/decnet/conf/%s/forwarding", ifr.ifr_name); + procfile = fopen(cmd, "w"); + if (!procfile) + { + fprintf(stderr, "Cannot set forwarding on interface\n"); + } + else + { + fprintf(procfile, "1"); + fclose(procfile); + } + + sprintf(cmd, "/proc/sys/net/decnet/conf/%s/priority", ifr.ifr_name); + procfile = fopen(cmd, "w"); + if (!procfile) + { + fprintf(stderr, "Cannot set priority on interface\n"); + } + else + { + fprintf(procfile, "%d", router_priority); + fclose(procfile); + } + + return tunfd; } + static void usage(char *cmd) + { + + printf("Usage: %s [-v12?h] [-p<prio>] [-P<port>] [-m<MTU>] <decnet-addr> <remote-host>\n", cmd); + printf("eg %s zarqon 3.2\n", cmd); + + printf(" -v Verbose output\n"); + printf(" -1 Advertise as a level 1 router\n"); + printf(" -2 Advertise as a level 2 router (default)\n"); + printf(" -p<prio> Router priority (default 64)\n"); + printf(" -P<port> IP port to talk to multinet on (default 700)\n"); + printf(" -m<MTU> MTU of interface (default 578)\n"); + + } + int main(int argc, char *argv[]) { *************** *** 398,427 **** struct addrinfo *ainfo; struct addrinfo ahints; ! if (argc > 2 && strcmp(argv[1], "-v") == 0) { ! argv++; ! argc--; ! verbose = 1; } ! if (argc < 3) { ! printf("Usage: %s [-v] <remote-addr> <decnet-addr>\n", argv[0]); ! printf("eg %s zarqon 3.2\n", argv[0]); ! exit(1); } ! if (sscanf(argv[2], "%d.%d", &area, &node) != 2) { ! fprintf(stderr, "DECnet address not valid\n"); return -1; } if (area > 63 || node > 1023) { ! fprintf(stderr, "DECnet address not valid\n"); return -1; } memset(&ahints, 0, sizeof(ahints)); ahints.ai_socktype = SOCK_DGRAM; --- 462,537 ---- struct addrinfo *ainfo; struct addrinfo ahints; + int res; + int opt; ! while ((opt=getopt(argc,argv,"vp:12m:P:?h")) != EOF) { ! switch(opt) ! { ! case 'v': ! verbose++; ! break; ! ! case '2': ! router_level = 2; ! break; ! case '1': ! router_level = 1; ! break; ! ! case 'p': ! router_priority = atoi(optarg); ! if (router_priority > 127 || router_priority < 0) ! { ! fprintf(stderr, "Router priority must be between 0 & 127\n"); ! exit(2); ! } ! break; ! case 'P': ! port = atoi(optarg); ! break; ! ! case 'm': ! mtu = atoi(optarg); ! if (mtu > 1500 || mtu < 20) ! { ! fprintf(stderr, "MTU is invalid\n"); ! exit(2); ! } ! break; ! ! case '?': ! case 'h': ! usage(argv[0]); ! break; ! ! } } ! if (argc - optind < 2) { ! usage(argv[0]); ! exit(2); } ! if (sscanf(argv[optind], "%d.%d", &area, &node) != 2) { ! fprintf(stderr, "DECnet address %s not valid\n", argv[optind]); return -1; } if (area > 63 || node > 1023) { ! fprintf(stderr, "DECnet address %d.%d not valid\n", area, node); return -1; } + /* Save address for later */ + addr = (area<<10) | node; + local_addr[0] = addr & 0xFF; + local_addr[1] = addr >> 8; + + /* Check remote address is valid */ + optind++; + memset(&ahints, 0, sizeof(ahints)); ahints.ai_socktype = SOCK_DGRAM; *************** *** 429,450 **** /* Lookup the nodename address */ ! if (getaddrinfo(argv[1], NULL, &ahints, &ainfo)) { ! perror("getaddrinfo"); ! return -errno; } memcpy(&remote_addr, ainfo->ai_addr, sizeof(struct sockaddr_in)); remote_addr.sin_family = AF_INET; ! remote_addr.sin_port = htons(PORT); ! ! ! addr = (area<<10) | node; ! local_addr[0] = addr & 0xFF; ! local_addr[1] = addr >> 8; tunfd = setup_tun(addr); ! ipfd = setup_ip(PORT); signal(SIGALRM, resend_start); alarm(10); --- 539,557 ---- /* Lookup the nodename address */ ! if ( (res=getaddrinfo(argv[optind], NULL, &ahints, &ainfo)) ) { ! fprintf(stderr, "Can't resolve name '%s': %s\n", argv[optind], gai_strerror(res)); ! return 2; } memcpy(&remote_addr, ainfo->ai_addr, sizeof(struct sockaddr_in)); remote_addr.sin_family = AF_INET; ! remote_addr.sin_port = htons(port); + /* initialise network ports */ tunfd = setup_tun(addr); ! ipfd = setup_ip(port); + /* Wait for START */ signal(SIGALRM, resend_start); alarm(10); |
From: Patrick C. <pa...@us...> - 2006-03-29 09:01:21
|
Update of /cvsroot/linux-decnet/dnprogs/multinet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29776 Modified Files: multinet.c Log Message: Fix multicasts Index: multinet.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/multinet/multinet.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** multinet.c 28 Mar 2006 12:58:17 -0000 1.2 --- multinet.c 29 Mar 2006 09:01:15 -0000 1.3 *************** *** 94,97 **** --- 94,98 ---- unsigned char header[38]; struct iovec iov[2]; + int header_len; if (!got_remote_addr) *************** *** 108,112 **** header[5] = local_addr[1]; ! if (mcast) /* Routing muticast - type may need to be in callers params */ { header[6] = 0x09; --- 109,113 ---- header[5] = local_addr[1]; ! if (mcast) /* Routing multicast - type may need to be in callers params */ { header[6] = 0x09; *************** *** 116,119 **** --- 117,121 ---- header[10] = 0x09; header[11] = 0x23; + header_len = 14; } else *************** *** 125,128 **** --- 127,131 ---- header[10] = remote_decnet_addr[0]; header[11] = remote_decnet_addr[1]; + header_len = sizeof(header); } header[12] = 0x60; /* DECnet packet type */ *************** *** 153,161 **** iov[0].iov_base = header; ! iov[0].iov_len = sizeof(header); iov[1].iov_base = buf; iov[1].iov_len = len; ! dump_data("to TUN0:", header, sizeof(header)); dump_data("to TUN1:", buf+6, len-6); --- 156,164 ---- iov[0].iov_base = header; ! iov[0].iov_len = header_len; iov[1].iov_base = buf; iov[1].iov_len = len; ! dump_data("to TUN0:", header, header_len); dump_data("to TUN1:", buf+6, len-6); *************** *** 254,268 **** dump_data("from IP:", buf, len); - - /* TODO Will need to resend this if other packets timeout */ if (buf[4] == 0x05) { got_verification = 1; alarm(0); - - // TODO for '0x05' send hello packet } ! /* Trap INIT & VERF messages */ if (buf[4] == 0x01 || buf[4] == 0x05) { --- 257,275 ---- dump_data("from IP:", buf, len); if (buf[4] == 0x05) { + // TODO what's this second MAC address????? 3.35 (in this packet) + unsigned char hello[] = {/* Router 2 hello message */ + 0x22, 0x00, 0x0b, 0x02, 0x00, 0x00, 0xaa, 0x00, 0x04, 0x00, buf[5], buf[6], 0x02, 0xda, 0x05, 0x40, + 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xaa, 0x00, 0x04, + 0x00, 0x02, 0x2c, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + + send_tun(1, hello, sizeof(hello)); // Should go to multicst ab-00-00-04-00-00, + got_verification = 1; alarm(0); } ! /* Trap INIT & VERF messages, they're for us */ if (buf[4] == 0x01 || buf[4] == 0x05) { *************** *** 279,284 **** return; } ! if (buf[4] == 0x03) return; if (buf[4] == 0x07) /* Routing info */ { --- 286,294 ---- return; } ! if (buf[4] == 0x03) // TODO check this ! return; ! if (buf[4] == 0x02) // TODO check this return; + if (buf[4] == 0x07) /* Routing info */ { |
From: Patrick C. <pa...@us...> - 2006-03-28 12:58:25
|
Update of /cvsroot/linux-decnet/dnprogs/multinet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2187 Modified Files: multinet.c Log Message: Don't make a mess of routing messages Index: multinet.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/multinet/multinet.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** multinet.c 28 Mar 2006 11:00:22 -0000 1.1 --- multinet.c 28 Mar 2006 12:58:17 -0000 1.2 *************** *** 90,94 **** ! static int send_tun(unsigned char *buf, int len) { unsigned char header[38]; --- 90,94 ---- ! static int send_tun(int mcast, unsigned char *buf, int len) { unsigned char header[38]; *************** *** 108,142 **** header[5] = local_addr[1]; ! header[6] = 0xAA; ! header[7] = 0x00; ! header[8] = 0x04; ! header[9] = 0x00; ! header[10] = remote_decnet_addr[0]; ! header[11] = remote_decnet_addr[1]; ! header[12] = 0x60; /* DECnet packet type */ header[13] = 0x03; ! /* DECnet packet length */ ! header[14] = (len+16) & 0xFF; ! header[15] = (len+16) >> 8; ! ! /* Fake DECnet header */ ! header[18] = header[19] = 0; ! header[16] = 0x81; header[17] = 0x26; // Don't know what this is! ! ! header[20] = header[28] = 0xAA; ! header[21] = header[29] = 0x00; ! header[22] = header[30] = 0x04; ! header[23] = header[31] = 0x00; ! header[24] = buf[1]; // Dest addr ! header[25] = buf[2]; ! header[32] = buf[3]; // src addr ! header[33] = buf[4]; iov[0].iov_base = header; iov[0].iov_len = sizeof(header); ! iov[1].iov_base = buf+6; ! iov[1].iov_len = len-6; dump_data("to TUN0:", header, sizeof(header)); --- 108,159 ---- header[5] = local_addr[1]; ! if (mcast) /* Routing muticast - type may need to be in callers params */ ! { ! header[6] = 0x09; ! header[7] = 0x00; ! header[8] = 0x00; ! header[9] = 0x00; ! header[10] = 0x09; ! header[11] = 0x23; ! } ! else ! { ! header[6] = 0xAA; ! header[7] = 0x00; ! header[8] = 0x04; ! header[9] = 0x00; ! header[10] = remote_decnet_addr[0]; ! header[11] = remote_decnet_addr[1]; ! } header[12] = 0x60; /* DECnet packet type */ header[13] = 0x03; ! if (!mcast) ! { ! /* DECnet packet length */ ! header[14] = (len+16) & 0xFF; ! header[15] = (len+16) >> 8; ! ! /* Fake DECnet header */ ! header[18] = header[19] = 0; ! header[16] = 0x81; header[17] = 0x26; // Don't know what this is! ! ! header[20] = header[28] = 0xAA; ! header[21] = header[29] = 0x00; ! header[22] = header[30] = 0x04; ! header[23] = header[31] = 0x00; ! header[24] = buf[1]; // Dest addr ! header[25] = buf[2]; ! header[32] = buf[3]; // src addr ! header[33] = buf[4]; ! ! buf += 6; ! len -= 6; ! } iov[0].iov_base = header; iov[0].iov_len = sizeof(header); ! iov[1].iov_base = buf; ! iov[1].iov_len = len; dump_data("to TUN0:", header, sizeof(header)); *************** *** 162,166 **** if (fudge_header) { - dump_data("FUDGE", buf, 16); /* Shorten DECnet addresses */ buf[0] = 0x02; // TODO what is this ?? --- 179,182 ---- *************** *** 244,258 **** got_verification = 1; alarm(0); } /* Trap INIT & VERF messages */ ! if ((buf[4] == 0x01 || buf[4] == 0x05) && !got_remote_addr) { ! unsigned short addr = buf[6]<<8 | buf[5]; ! got_remote_addr = 1; ! remote_decnet_addr[0] = buf[5]; ! remote_decnet_addr[1] = buf[6]; ! printf("Remote address = %d.%d (%d)\n", addr>>10, addr&1023, addr); return; --- 260,279 ---- got_verification = 1; alarm(0); + + // TODO for '0x05' send hello packet } /* Trap INIT & VERF messages */ ! if (buf[4] == 0x01 || buf[4] == 0x05) { ! if (!got_remote_addr) ! { ! unsigned short addr = buf[6]<<8 | buf[5]; ! got_remote_addr = 1; ! remote_decnet_addr[0] = buf[5]; ! remote_decnet_addr[1] = buf[6]; ! printf("Remote address = %d.%d (%d)\n", addr>>10, addr&1023, addr); ! } return; *************** *** 260,265 **** if (buf[4] == 0x03) return; ! send_tun(buf+4, len-4); } --- 281,318 ---- if (buf[4] == 0x03) return; + if (buf[4] == 0x07) /* Routing info */ + { + /* + off ethernet: + 13:17:58.021480 lev-2-routing src 3.35 {areas 1-64 cost 4 hops 1} + 0x0000: 8800 0923 0c00 3f00 0100 0404 0a04 0000 + 0x0010: ff7f ff7f ff7f ff7f ff7f ff7f ff7f 0404 + 0x0020: ff7f ff7f ff7f ff7f ff7f ff7f ff7f ff7f + 0x0030: ff7f ff7f ff7f ff7f ff7f ff7f 2428 1e08 + 0x0040: ff7f ff7f ff7f ff7f ff7f ff7f ff7f ff7f + 0x0050: ff7f ff7f ff7f ff7f ff7f ff7f ff7f ff7f + 0x0060: ff7f ff7f ff7f ff7f ff7f ff7f ff7f ff7f + 0x0070: ff7f ff7f ff7f ff7f ff7f ff7f ff7f 1408 + 0x0080: ff7f ff7f ff7f ff7f 8d44 + + off Multinet: + 09 00 00 00 09 23 + 0c 00 3f 00 01 00 04 04 0a 04 00 00 + ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f 04 04 + ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f + ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f 04 04 1e 08 + ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f + ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f + ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f + ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f 14 08 + ff 7f ff 7f ff 7f ff 7f 6d 20 + */ + buf[2] = len % 0xFF; + buf[3] = len >> 8; + send_tun(1, buf+2, len-2); + return; + } ! send_tun(0, buf+4, len-4); } |
From: Patrick C. <pa...@us...> - 2006-03-28 11:00:33
|
Update of /cvsroot/linux-decnet/dnprogs/multinet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4935/multinet Added Files: Makefile multinet.c Log Message: First stab a multinet-compatible daemon --- NEW FILE: Makefile --- CFLAGS=-Wall -g all: multinet multinet: multinet.c $(CC) $(CFLAGS) $(LDFLAGS) -o multinet multinet.c --- NEW FILE: multinet.c --- /****************************************************************************** (c) 2006 P.J. 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. ******************************************************************************* Multinet server proxy server for Linux. This daemon talks to a VMS system running a multinet DECnet/IP tunnel. (www.process.com/tcpip/multinet.html) You'll need to set up the VMS end to talk to this box. It creates a tun/tap device and assigns it a suitable MAC address. */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/poll.h> #include <sys/errno.h> #include <sys/signal.h> #include <sys/signal.h> #include <sys/signal.h> #include <netinet/in.h> #include <fcntl.h> #include <string.h> #include <termios.h> #include <netdb.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <linux/if.h> #include <linux/if_tun.h> static int verbose; static int ipfd; static int tunfd; static unsigned short local_addr[2]; static struct sockaddr_in remote_addr; static int got_remote_addr; static unsigned char remote_decnet_addr[2]; static int got_verification; #define PORT 700 #define DUMP_MAX 1024 static int send_ip(int use_seq, unsigned char *, int len); static void dump_data(char *from, unsigned char *databuf, int datalen) { int i; if (!verbose) return; fprintf(stderr, "%s (%d)", from, datalen); for (i=0; i<(datalen>DUMP_MAX?DUMP_MAX:datalen); i++) { fprintf(stderr, "%02x ", databuf[i]); } fprintf(stderr, "\n"); } static void send_start(unsigned short addr) { unsigned char start[] = { 0x01, 0x08, 0x05, 0x05, 0x40,0x02, 0x02,0x00, 0x00,0x2c, 0x01,0x00, 0x00,0x00,}; unsigned char verf[] = { 0x03, 0x02, 0x0c, 0x00}; start[1] = addr & 0xff; start[2] = addr >> 8; send_ip(0, start, sizeof(start)); verf[1] = addr & 0xff; verf[2] = addr >> 8; send_ip(0, verf, sizeof(verf)); } static int send_tun(unsigned char *buf, int len) { unsigned char header[38]; struct iovec iov[2]; if (!got_remote_addr) return 0; /* Can't send yet */ memset(header, 0, sizeof(header)); // Add ethernet header header[0] = 0xAA; header[1] = 0x00; header[2] = 0x04; header[3] = 0x00; header[4] = local_addr[0]; header[5] = local_addr[1]; header[6] = 0xAA; header[7] = 0x00; header[8] = 0x04; header[9] = 0x00; header[10] = remote_decnet_addr[0]; header[11] = remote_decnet_addr[1]; header[12] = 0x60; /* DECnet packet type */ header[13] = 0x03; /* DECnet packet length */ header[14] = (len+16) & 0xFF; header[15] = (len+16) >> 8; /* Fake DECnet header */ header[18] = header[19] = 0; header[16] = 0x81; header[17] = 0x26; // Don't know what this is! header[20] = header[28] = 0xAA; header[21] = header[29] = 0x00; header[22] = header[30] = 0x04; header[23] = header[31] = 0x00; header[24] = buf[1]; // Dest addr header[25] = buf[2]; header[32] = buf[3]; // src addr header[33] = buf[4]; iov[0].iov_base = header; iov[0].iov_len = sizeof(header); iov[1].iov_base = buf+6; iov[1].iov_len = len-6; dump_data("to TUN0:", header, sizeof(header)); dump_data("to TUN1:", buf+6, len-6); writev(tunfd, iov, 2); return len; } static int send_ip(int fudge_header, unsigned char *buf, int len) { struct iovec iov[2]; unsigned char header[4]; struct msghdr msg; static unsigned short seq; memset(&msg, 0, sizeof(msg)); seq++; header[0] = seq & 0xFF; header[1] = seq >> 8; header[2] = header[3] = 0; if (fudge_header) { dump_data("FUDGE", buf, 16); /* Shorten DECnet addresses */ buf[0] = 0x02; // TODO what is this ?? buf[1] = buf[8]; // Destination buf[2] = buf[9]; buf[3] = buf[16]; // Source buf[4] = buf[17]; buf[5] = 0; memmove(buf+6, buf+22, len-16); len -= 16; } iov[0].iov_base = header; iov[0].iov_len = sizeof(header); iov[1].iov_base = buf; iov[1].iov_len = len; msg.msg_iov = iov; msg.msg_iovlen = 2; msg.msg_name = (void *)&remote_addr; msg.msg_namelen = sizeof(struct sockaddr_in); // dump_data("Send to IP0", header, sizeof(header)); dump_data("Send to IP1:", buf, len); if (sendmsg(ipfd, &msg, 0) <= 0) perror("sendmsg"); return 0; } static int setup_ip(int port) { int fd; struct sockaddr_in sin; fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); if (fd < 0) return -1; sin.sin_family = AF_INET; sin.sin_port = htons(port); sin.sin_addr.s_addr = INADDR_ANY; if (bind(fd, (struct sockaddr *)&sin, sizeof(struct sockaddr_in))) { perror("bind"); close(fd); return -1; } return fd; } void resend_start(int sig) { if (!got_verification) { unsigned short addr = (local_addr[0] | local_addr[1]<<8); send_start(addr); alarm(10); } } static void read_ip(void) { unsigned char buf[1600]; int len; len = read(ipfd, buf, sizeof(buf)); if (len <= 0) return; dump_data("from IP:", buf, len); /* TODO Will need to resend this if other packets timeout */ if (buf[4] == 0x05) { got_verification = 1; alarm(0); } /* Trap INIT & VERF messages */ if ((buf[4] == 0x01 || buf[4] == 0x05) && !got_remote_addr) { unsigned short addr = buf[6]<<8 | buf[5]; got_remote_addr = 1; remote_decnet_addr[0] = buf[5]; remote_decnet_addr[1] = buf[6]; printf("Remote address = %d.%d (%d)\n", addr>>10, addr&1023, addr); return; } if (buf[4] == 0x03) return; send_tun(buf+4, len-4); } static void read_tun(void) { unsigned char buf[1600]; int len; len = read(tunfd, buf, sizeof(buf)); if (len <= 0) return; /* Only send DECnet packets... */ if (buf[12] == 0x60 && buf[13] == 0x03) { dump_data("DECnet from TUN:", buf, len); /* Ignore our echoed packets */ if (buf[4] == local_addr[0] && buf[5] == local_addr[1]) { if (verbose) fprintf(stderr, "Ignoring our own packet\n"); return; } if (buf[16] == 0x0d) // Ethernet Hello, (TODO check routing ones too ?) { unsigned char ptp_hello[] = { 0x5, buf[10], buf[11], 0252, 0252, 0252, 0252}; if (verbose) fprintf(stderr, "Sending PTP hello\n"); send_ip(0, ptp_hello, sizeof(ptp_hello)); return ; } send_ip(1, buf+16, len-16); } } static int setup_tun(unsigned short addr) { int ret; struct ifreq ifr; char cmd[132]; tunfd = open("/dev/net/tun", O_RDWR); if (tunfd < 0) { perror("could not open /dev/net/tun"); exit(2); } memset(&ifr, 0, sizeof(ifr)); ifr.ifr_flags = IFF_TAP | IFF_NO_PI; strcpy(ifr.ifr_name, "tap%d"); ret = ioctl(tunfd, TUNSETIFF, (void *) &ifr); if (ret != 0) { perror("could not configure /dev/net/tun"); exit(2); } fprintf(stderr, "using tun device %s\n", ifr.ifr_name); sprintf(cmd, "/sbin/ifconfig %s hw ether AA:00:04:00:%02X:%02X allmulti mtu 576 up\n", ifr.ifr_name, addr & 0xFF, addr>>8); system(cmd); return tunfd; } int main(int argc, char *argv[]) { struct pollfd pfds[2]; unsigned int area, node; unsigned short addr; struct addrinfo *ainfo; struct addrinfo ahints; if (argc > 2 && strcmp(argv[1], "-v") == 0) { argv++; argc--; verbose = 1; } if (argc < 3) { printf("Usage: %s [-v] <remote-addr> <decnet-addr>\n", argv[0]); printf("eg %s zarqon 3.2\n", argv[0]); exit(1); } if (sscanf(argv[2], "%d.%d", &area, &node) != 2) { fprintf(stderr, "DECnet address not valid\n"); return -1; } if (area > 63 || node > 1023) { fprintf(stderr, "DECnet address not valid\n"); return -1; } memset(&ahints, 0, sizeof(ahints)); ahints.ai_socktype = SOCK_DGRAM; ahints.ai_protocol = IPPROTO_UDP; /* Lookup the nodename address */ if (getaddrinfo(argv[1], NULL, &ahints, &ainfo)) { perror("getaddrinfo"); return -errno; } memcpy(&remote_addr, ainfo->ai_addr, sizeof(struct sockaddr_in)); remote_addr.sin_family = AF_INET; remote_addr.sin_port = htons(PORT); addr = (area<<10) | node; local_addr[0] = addr & 0xFF; local_addr[1] = addr >> 8; tunfd = setup_tun(addr); ipfd = setup_ip(PORT); signal(SIGALRM, resend_start); alarm(10); send_start(addr); pfds[0].fd = ipfd; pfds[0].events = POLLIN; pfds[1].fd = tunfd; pfds[1].events = POLLIN; fcntl(ipfd, F_SETFL, fcntl(ipfd, F_GETFL, 0) | O_NONBLOCK); fcntl(tunfd, F_SETFL, fcntl(tunfd, F_GETFL, 0) | O_NONBLOCK); while (1) { int status; status = poll(pfds, 2, -1); if (status == -1 && errno != EINTR) { perror("poll"); exit(1); } if (pfds[0].revents & POLLIN) read_ip(); if (pfds[1].revents & POLLIN) read_tun(); } return 0; } |
From: Patrick C. <pa...@us...> - 2006-03-28 10:58:45
|
Update of /cvsroot/linux-decnet/dnprogs/multinet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4010/multinet Log Message: Directory /cvsroot/linux-decnet/dnprogs/multinet added to the repository |
From: Patrick C. <pa...@us...> - 2006-03-21 17:04:50
|
Update of /cvsroot/linux-decnet/dnprogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25686 Modified Files: TODO Log Message: Fixed that one... Index: TODO =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/TODO,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** TODO 17 Jan 2006 11:35:29 -0000 1.7 --- TODO 21 Mar 2006 17:04:43 -0000 1.8 *************** *** 6,12 **** RSX-friendly code. - ctermd - Logs "NCT -- Internal error " on RSX when disconnecting. - phone: Race condition in ANSWER where you can get the message "no-one is calling --- 6,9 ---- |
From: Patrick C. <pa...@us...> - 2006-03-21 17:03:25
|
Update of /cvsroot/linux-decnet/dnprogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24750 Modified Files: README Log Message: Update Index: README =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/README,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** README 4 May 2003 11:56:49 -0000 1.7 --- README 21 Mar 2006 17:03:18 -0000 1.8 *************** *** 36,40 **** time. ! NOTE: These startup scripts are out of date for everthing except Debian. If you can help with startup scripts for your particular distribution then please contact me. --- 36,40 ---- time. ! NOTE: These startup scripts are out of date for everything except Debian. If you can help with startup scripts for your particular distribution then please contact me. *************** *** 116,124 **** dndir - show VMS directories dndel - delete VMS files ! sethost - connect a terminal session to VMS dnping - "ping" (NCP LOOP NODE) a VMS machine dnsubmit - submit batch jobs to a VMS queue dnprint - print files on a VMS printer phone - phone client Administrator programs and daemons in /usr/local/sbin: --- 116,125 ---- dndir - show VMS directories dndel - delete VMS files ! dnlogin - connect a terminal session to VMS dnping - "ping" (NCP LOOP NODE) a VMS machine dnsubmit - submit batch jobs to a VMS queue dnprint - print files on a VMS printer phone - phone client + sethost - old terminal client. use dnlogin instead. Administrator programs and daemons in /usr/local/sbin: *************** *** 159,162 **** --- 160,167 ---- excellent efforts of the Lesstif team, is merely a legacy toolkit. + UPDATE: GTK+2 is now more common and (probably) better. I have no intention of + updating phone to use this. It's just a waste of effort. If you really want + a GTK+2 version of phone, send me the patch. + Writing DECnet programs *************** *** 226,230 **** SUPPORT ------- ! These programs have been tested on Linux 2.0, 2.1, 2.2, 2.3 & 2.4 on Intel, Alpha, SPARC and parisc machines (though not necessarily all combinations!). --- 231,235 ---- SUPPORT ------- ! These programs have been tested on Linux 2.0, 2.1, 2.2, 2.3, 2.4 & 2.6 on Intel, Alpha, SPARC and parisc machines (though not necessarily all combinations!). |
From: Patrick C. <pa...@us...> - 2006-03-21 16:54:16
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19756 Modified Files: cterm.c dnlogin.c found.c Log Message: RSX doesn't like (my) WRITE COMPLETION messages and VMS can do without them, so don't bother sending them. Index: cterm.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/cterm.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** cterm.c 21 Mar 2006 16:32:01 -0000 1.26 --- cterm.c 21 Mar 2006 16:54:02 -0000 1.27 *************** *** 262,265 **** --- 262,266 ---- {return len;} + #if 0 static void send_write_complete(void) { *************** *** 276,279 **** --- 277,281 ---- found_common_write(newbuf, 6); } + #endif static void send_prepostfix(int flag, char data) *************** *** 349,354 **** --- 351,359 ---- send_prepostfix(((flags >> 8) & 3), postfixdata); //QQ + #if 0 + // This break RSX, and VMS is happy without it... if (flags & 2) send_write_complete(); + #endif return len; Index: dnlogin.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** dnlogin.c 21 Mar 2006 16:32:01 -0000 1.14 --- dnlogin.c 21 Mar 2006 16:54:02 -0000 1.15 *************** *** 11,16 **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ****************************************************************************** ! */ #include <stdio.h> --- 11,15 ---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! *******************************************************************************/ #include <stdio.h> Index: found.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/found.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** found.c 21 Mar 2006 16:32:01 -0000 1.20 --- found.c 21 Mar 2006 16:54:02 -0000 1.21 *************** *** 165,169 **** if ( (len=dnet_recv(sockfd, inbuf, sizeof(inbuf), MSG_EOR|MSG_DONTWAIT|MSG_NOSIGNAL)) <= 0) ! { if (len == -1 && (errno == EAGAIN || errno == ESPIPE)) --- 165,169 ---- if ( (len=dnet_recv(sockfd, inbuf, sizeof(inbuf), MSG_EOR|MSG_DONTWAIT|MSG_NOSIGNAL)) <= 0) ! { if (len == -1 && (errno == EAGAIN || errno == ESPIPE)) |
From: Patrick C. <pa...@us...> - 2006-03-21 16:32:24
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7421 Modified Files: Makefile cterm.c dnlogin.c dnlogin.h found.c tty.c Log Message: Tidy debugging macros. Much better CF/LF handling. Build with -Wall Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** Makefile 21 Mar 2006 08:38:42 -0000 1.6 --- Makefile 21 Mar 2006 16:32:01 -0000 1.7 *************** *** 9,13 **** PROG1OBJS=dnlogin.o found.o cterm.o tty.o ! CFLAGS+=-funsigned-char CFLAGS+=-g --- 9,13 ---- PROG1OBJS=dnlogin.o found.o cterm.o tty.o ! CFLAGS+=-funsigned-char -Wall CFLAGS+=-g Index: cterm.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/cterm.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** cterm.c 21 Mar 2006 08:38:42 -0000 1.25 --- cterm.c 21 Mar 2006 16:32:01 -0000 1.26 *************** *** 137,142 **** buf[i] = '\0'; skipped = 1; ! if (debug & 2) ! fprintf(stderr, "PJC: skipping this LF\n"); break; } --- 137,141 ---- buf[i] = '\0'; skipped = 1; ! DEBUG_CTERM("skipping this LF\n"); break; } *************** *** 174,178 **** int ptr = 0; unsigned char ZZ, EE, DDD, Q, II; - int old_esc_state; flags = buf[1] | (buf[2] << 8) | (buf[3] << 16); --- 173,176 ---- *************** *** 198,202 **** // C 1=clear typeahead // F 1=if last char was CR, end LF, discard LF if first char of ! // preloaded input (whatever that is) // V 1=Terminate if vertical pos changes while echoing input char. // K 1=This is a continuation of previous read - see doc --- 196,200 ---- // C 1=clear typeahead // F 1=if last char was CR, end LF, discard LF if first char of ! // preloaded input // V 1=Terminate if vertical pos changes while echoing input char. // K 1=This is a continuation of previous read - see doc *************** *** 212,225 **** // ! if (debug & 2) fprintf(stderr, "CTERM: process_start_read. flags = %x (ZZ=%d)\n",flags, ZZ); ! if (debug & 2) fprintf(stderr, "CTERM: len=%d, term_len=%d, ptr=%d\n", ! len, term_len, ptr); ! if (debug & 2) fprintf(stderr, "CTERM: Q=%d timeout = %d, EE=%d\n", Q, timeout, EE); if (flags & 4) tty_clear_typeahead(); if (flags & 0x800) tty_set_noecho(); ! if (flags & 0x8 && buf[ptr+1] != '\n') tty_format_cr(); if (ZZ==1) tty_set_terminators(buf+ptr, term_len); --- 210,228 ---- // ! if (debug & 2) DEBUG_CTERM("process_start_read. flags = %x\n",flags); ! if (debug & 2) DEBUG_CTERM("len=%d, term_len=%d, ptr=%d\n", ! len, term_len, ptr); ! if (debug & 2) DEBUG_CTERM("Q=%d timeout = %d, EE=%d, ZZ=%d\n", Q, timeout, EE, ZZ); if (flags & 4) tty_clear_typeahead(); if (flags & 0x800) tty_set_noecho(); ! // PJC not happy with this last clause but editors seem to need it. ! if (flags & 0x8 && ! buf[ptr+term_len] != '\n' && buf[ptr+term_len+1] != '\n' && eoprompt) ! { ! DEBUG_CTERM("format CR: char1=%x, char2=%x, eoprompt=%d\n", buf[ptr+term_len], buf[ptr+term_len+1], eoprompt); tty_format_cr(); + } if (ZZ==1) tty_set_terminators(buf+ptr, term_len); *************** *** 259,268 **** {return len;} static void send_prepostfix(int flag, char data) { - int i; char feed; ! if (debug & 2)fprintf(stderr, "CTERM: send_prepostfix: flag =%d, data=%d\n", flag, data); if (flag == 0) return; --- 262,285 ---- {return len;} + static void send_write_complete(void) + { + char newbuf[6]; + + DEBUG_CTERM("Sending write complete\n"); + newbuf[0] = CTERM_MSG_WRITE_COMPLETE; + newbuf[1] = 0; + newbuf[2] = 0 & 0xFF; // Horiz pos + newbuf[3] = (0 >> 8) & 0xFF; + newbuf[4] = 0 & 0xFF; // Vert pos + newbuf[5] = (0 >> 8) & 0xFF; + + found_common_write(newbuf, 6); + } + static void send_prepostfix(int flag, char data) { char feed; ! DEBUG_CTERM("send_prepostfix: flag =%d, data=%d\n", flag, data); if (flag == 0) return; *************** *** 298,306 **** // E 1=This is the end of a host data message // PP 1=prefixdata is a newline count, 2=prefixdata=character ! // QQ 1=postfix is a newline count, 2=postfix=character ! // S 1=Send write completion when this wrote completes // T 1=This data is written to foundation services transparently ! if (debug & 2) fprintf(stderr, "CTERM: process_write flags = %x (prefix=%d,postfix=%d)\n",flags, prefixdata, postfixdata); tty_set_discard(!(flags>>3)); --- 315,323 ---- // E 1=This is the end of a host data message // PP 1=prefixdata is a newline count, 2=prefixdata=character ! // QQ 1=postfix is a newline count, 2=postfix=character ! // S 1=Send write completion when this write completes // T 1=This data is written to foundation services transparently ! DEBUG_CTERM("process_write flags = %x (prefix=%d,postfix=%d)\n",flags, prefixdata, postfixdata); tty_set_discard(!(flags>>3)); *************** *** 319,324 **** if (!skip_next_lf) { ! if (debug & 2) ! fprintf(stderr, "PJC: sending feed, skipping next LF\n"); tty_write(&feed, 1); skip_next_lf = 1; --- 336,340 ---- if (!skip_next_lf) { ! DEBUG_CTERM("sending feed, skipping next LF\n"); tty_write(&feed, 1); skip_next_lf = 1; *************** *** 326,331 **** else { ! if (debug & 2) ! fprintf(stderr, "PJC: NOT sending feed, skip_next_lf set\n"); skip_next_lf = 0; } --- 342,346 ---- else { ! DEBUG_CTERM("NOT sending feed, skip_next_lf set\n"); skip_next_lf = 0; } *************** *** 334,337 **** --- 349,355 ---- send_prepostfix(((flags >> 8) & 3), postfixdata); //QQ + if (flags & 2) + send_write_complete(); + return len; } *************** *** 348,352 **** char outbuf[256]; int outptr = 0; - int procnt = 0; outbuf[outptr++] = CTERM_MSG_CHARACTERISTINCS; --- 366,369 ---- *************** *** 358,363 **** bufptr += 2; ! if (debug & 2) ! fprintf(stderr, "CTERM: selector = 0x%x\n", selector); if ((selector & 0x200) == 0) /* Physical characteristics */ --- 375,379 ---- bufptr += 2; ! DEBUG_CTERM("selector = 0x%x\n", selector); if ((selector & 0x200) == 0) /* Physical characteristics */ *************** *** 583,588 **** { // TODO other characteristics ? ! if (debug & 2) ! fprintf(stderr, "Discarding rest of attrs, ptr=%d, len=%d\n",bufptr, len); return len; } --- 599,603 ---- { // TODO other characteristics ? ! DEBUG_CTERM("Discarding rest of attrs, ptr=%d, len=%d\n",bufptr, len); return len; } *************** *** 602,608 **** char_attr[(int)c] |= (val & mask); // set the new ones. bufptr += 3; ! if (debug & 2) ! fprintf(stderr, "CTERM: Setting characteristics for char %d to 0x%x\n", ! c, char_attr[(int)c]); break; --- 617,622 ---- char_attr[(int)c] |= (val & mask); // set the new ones. bufptr += 3; ! DEBUG_CTERM("Setting characteristics for char %d to 0x%x\n", ! c, char_attr[(int)c]); break; *************** *** 679,684 **** while (offset < len) { ! if (debug & 2) fprintf(stderr, "CTERM: got msg: %d, len=%d\n", ! buf[offset], len); switch (buf[offset]) --- 693,698 ---- while (offset < len) { ! DEBUG_CTERM("got msg: %d, len=%d\n", ! buf[offset], len); switch (buf[offset]) *************** *** 741,745 **** char newbuf[3]; int ret; ! if (debug & 2) fprintf(stderr, "CTERM: sending OOB char %d\n", oobchar); newbuf[0] = CTERM_MSG_OOB; --- 755,760 ---- char newbuf[3]; int ret; ! ! DEBUG_CTERM("sending OOB char %d\n", oobchar); newbuf[0] = CTERM_MSG_OOB; *************** *** 771,776 **** { char newbuf[len+9]; ! if (debug & 2) fprintf(stderr, "CTERM: sending input data: len=%d\n", ! len); newbuf[0] = CTERM_MSG_READ_DATA; --- 786,790 ---- { char newbuf[len+9]; ! DEBUG_CTERM("sending input data: len=%d\n", len); newbuf[0] = CTERM_MSG_READ_DATA; Index: dnlogin.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** dnlogin.c 24 Jan 2006 14:05:09 -0000 1.13 --- dnlogin.c 21 Mar 2006 16:32:01 -0000 1.14 *************** *** 121,128 **** int main(int argc, char *argv[]) { - struct sigaction sa; - sigset_t ss; int opt; - char *nodename; // Deal with command-line arguments. --- 121,125 ---- Index: dnlogin.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** dnlogin.h 27 Oct 2005 08:18:01 -0000 1.17 --- dnlogin.h 21 Mar 2006 16:32:01 -0000 1.18 *************** *** 76,77 **** --- 76,92 ---- #define SEND_FLAG_PARITY_ERROR 12 #define SEND_FLAG_OVERRUN 13 + + /* DEBUG flags */ + #define DEBUG_FLAG_FOUND 1 + #define DEBUG_FLAG_CTERM 2 + #define DEBUG_FLAG_TTY 4 + #define DEBUG_FLAG_FOUND2 8 + #define DEBUG_FLAG_TTY2 16 + + #define DEBUGLOG(subsys, args...) if (debug & subsys) fprintf(stderr, args) + + #define DEBUG_FOUND(args...) DEBUGLOG(DEBUG_FLAG_FOUND, "FOUND: " args) + #define DEBUG_FOUND2(args...) DEBUGLOG(DEBUG_FLAG_FOUND2, "FOUND2: " args) + #define DEBUG_CTERM(args...) DEBUGLOG(DEBUG_FLAG_CTERM, "CTERM: " args) + #define DEBUG_TTY(args...) DEBUGLOG(DEBUG_FLAG_TTY, "TTY: " args) + #define DEBUG_TTY2(args...) DEBUGLOG(DEBUG_FLAG_TTY2, "TTY2: " args) Index: found.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/found.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** found.c 24 Jan 2006 14:05:09 -0000 1.19 --- found.c 21 Mar 2006 16:32:01 -0000 1.20 *************** *** 1,4 **** /****************************************************************************** ! (c) 2002 P.J. Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2002-2006 P.J. Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 127,138 **** struct common_header header; ! if (debug & 1) fprintf(stderr, "FOUND: sending %d bytes\n", len); ! if (debug & 8) { int i; ! for (i=0; i<len; i++) ! fprintf(stderr, "%02x ", (char)buf[i]); ! fprintf(stderr, "\n\n"); } --- 127,138 ---- struct common_header header; ! DEBUG_FOUND("sending %d bytes\n", len); ! if (debug & DEBUG_FLAG_FOUND2) { int i; ! DEBUG_FOUND2("sending: "); for (i=0; i<len; i++) ! DEBUGLOG(DEBUG_FLAG_FOUND2, "%02x ", (char)buf[i]); ! DEBUGLOG(DEBUG_FLAG_FOUND2, "\n\n"); } *************** *** 154,159 **** header.len = dn_htons(len); ! if (debug & 1) ! fprintf(stderr, "FOUND: sending common message %d bytes:\n", len); return sendmsg(sockfd, &msg, MSG_EOR); --- 154,158 ---- header.len = dn_htons(len); ! DEBUG_FOUND("sending common message %d bytes:\n", len); return sendmsg(sockfd, &msg, MSG_EOR); *************** *** 164,168 **** int len; char inbuf[1024]; - int ptr = 0; if ( (len=dnet_recv(sockfd, inbuf, sizeof(inbuf), MSG_EOR|MSG_DONTWAIT|MSG_NOSIGNAL)) <= 0) --- 163,166 ---- *************** *** 182,194 **** } ! if (debug & 1) ! fprintf(stderr, "FOUND: got message %d bytes:\n", len); ! if (debug & 8) { int i; for (i=0; i<len; i++) ! fprintf(stderr, "%02x ", (char)inbuf[i]); ! fprintf(stderr, "\n\n"); } --- 180,192 ---- } ! DEBUG_FOUND("got message %d bytes:\n", len); ! if (debug & DEBUG_FLAG_FOUND2) { int i; + DEBUG_FOUND2("read: "); for (i=0; i<len; i++) ! DEBUGLOG(DEBUG_FLAG_FOUND2, "%02x ", (char)inbuf[i]); ! DEBUGLOG(DEBUG_FLAG_FOUND2, "\n\n"); } *************** *** 198,208 **** { case FOUND_MSG_BIND: ! if (debug & 1) ! fprintf(stderr, "FOUND: connected to %s host\n", hosttype[inbuf[4]-1]); return send_bindaccept(); case FOUND_MSG_UNBIND: ! if (debug & 1) ! fprintf(stderr, "FOUND: Unbind from host. reason = %d\n", inbuf[1]); return -1; --- 196,204 ---- { case FOUND_MSG_BIND: ! DEBUG_FOUND("connected to %s host\n", hosttype[inbuf[4]-1]); return send_bindaccept(); case FOUND_MSG_UNBIND: ! DEBUG_FOUND("Unbind from host. reason = %d\n", inbuf[1]); return -1; *************** *** 210,215 **** { char nomode_msg[] = {0x8}; ! if (debug) ! fprintf(stderr, "FOUND: Request to enter mode = %d\n", inbuf[1]); write(sockfd, nomode_msg, sizeof(nomode_msg)); return 0; --- 206,210 ---- { char nomode_msg[] = {0x8}; ! DEBUG_FOUND("Request to enter mode = %d\n", inbuf[1]); write(sockfd, nomode_msg, sizeof(nomode_msg)); return 0; *************** *** 224,229 **** int msglen = inbuf[ptr] | inbuf[ptr+1]<<8; ! if (debug&1) ! fprintf(stderr, "FOUND: commondata: %d bytes\n",msglen); ptr += 2; --- 219,223 ---- int msglen = inbuf[ptr] | inbuf[ptr+1]<<8; ! DEBUG_FOUND("commondata: %d bytes\n",msglen); ptr += 2; Index: tty.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** tty.c 21 Mar 2006 08:38:42 -0000 1.29 --- tty.c 21 Mar 2006 16:32:01 -0000 1.30 *************** *** 50,53 **** --- 50,54 ---- static char esc_buf[132]; static int esc_len=0; + static int esc_state=0; static int max_read_len = sizeof(input_buf); static int echo = 1; *************** *** 70,73 **** --- 71,158 ---- void (*rahead_change)(int count); + /* Escape parser. See appx B of cterm.txt. + returns 0 if we have terminated the sequenec (or an error) + returns 1 if we are stll in an escape sequence */ + + /* Note that all the numbered rules fall through to the next rule */ + static int parse_escape(char c, int *state) + { + switch (*state) + { + case 0: + if (c == '?' || c == ';') + { + *state = 10; + return 1; + } + if (c == 'O') + { + *state = 20; + return 1; + } + if (c == 'Y') + { + *state = 30; + return 1; + } + if (c == '[') + { + *state = 15; + return 1; + } + + case 10: + if (c >= 32 && c <= 47) + { + *state = 10; + return 1; + } + if (c >= 48 && c <= 126) + { + *state = 0; + return 0; + } + + case 15: + if (c >= 48 && c <= 63) + { + *state = 15; + return 1; + } + + case 20: + if (c >= 32 && c <= 47) + { + *state = 20; + return 1; + } + if (c >= 64 && c <= 126) + { + *state = 0; + return 0; + } + + case 30: + if (c >= 32 && c <= 126) + { + *state = 40; + return 1; + } + + case 40: + if (c >= 32 && c <= 126) + { + *state = 0; + return 0; + } + break; + default: + *state = 0; + return 0; + } + return 0; + } + + static void send_input_buffer(int flags) { *************** *** 80,85 **** input_len = input_pos = 0; reading = 0; ! if (debug & 4) ! fprintf(stderr, "TTY: clearing 'reading' flag\n"); echo = 1; interpret_escape = 0; --- 165,169 ---- input_len = input_pos = 0; reading = 0; ! DEBUG_TTY("clearing 'reading' flag\n"); echo = 1; interpret_escape = 0; *************** *** 89,94 **** void tty_timeout() { ! if (debug & 4) ! fprintf(stderr, "TTY: timeout\n"); send_input_buffer(SEND_FLAG_TIMEOUT); } --- 173,177 ---- void tty_timeout() { ! DEBUG_TTY("timeout\n"); send_input_buffer(SEND_FLAG_TIMEOUT); } *************** *** 97,101 **** int tty_write(char *buf, int len) { ! int in_esc = 0; /* escapes can't stradde writes ??? */ if (discard) --- 180,185 ---- int tty_write(char *buf, int len) { ! int in_esc = 0; /* escapes can't straddle writes */ ! int esc_state = 0; if (discard) *************** *** 113,123 **** } ! if (debug & 16) { int i; ! fprintf(stderr, "TTY: Printing %d: ", len); for (i=0; i<len; i++) ! fprintf(stderr, "%02x ", (unsigned char)buf[i]); ! fprintf(stderr, "\n"); } --- 197,216 ---- } ! if (debug & DEBUG_FLAG_TTY2) { int i; ! DEBUG_TTY2("Printing %d: ", len); for (i=0; i<len; i++) ! { ! if (isgraph(buf[i])) ! { ! DEBUGLOG(DEBUG_FLAG_TTY2, "%c ", buf[i]); ! } ! else ! { ! DEBUGLOG(DEBUG_FLAG_TTY2, "0x%02x ", (unsigned char)buf[i]); ! } ! } ! DEBUGLOG(DEBUG_FLAG_TTY2, "\n"); } *************** *** 126,141 **** if (len) { ! int i; ! for (i=0; i<len; i++) { ! if (buf[i] == ESC) ! in_esc = 1; ! if (!in_esc && buf[i]) ! last_char = buf[i]; ! if (in_esc && (isalpha(buf[i]) || buf[i] == '~' || buf[i] == '>')) ! in_esc = 0; } ! if (debug & 4) ! fprintf(stderr, "TTY: Setting last_char to %02x\n", last_char); } return len; --- 219,247 ---- if (len) { ! /* if interpret_escape is set then we don't include escape sequences ! as possible "last_char"s ! */ ! if (!interpret_escape) ! { ! int i; ! for (i=0; i<len; i++) ! { ! if (buf[i] == ESC) ! in_esc = 1; ! else ! { ! if (!in_esc && buf[i]) ! last_char = buf[i]; ! if (in_esc && !parse_escape(buf[i], &esc_state)) ! in_esc = 0; ! } ! } ! } ! else { ! last_char = buf[len-1]; } ! ! DEBUG_TTY("Setting last_char to %02x, interpret_escape=%d\n", last_char, interpret_escape); } return len; *************** *** 151,156 **** char lf = '\n'; ! if (debug & 4) ! fprintf(stderr, "TTY: format_cr, last char was %x\n", last_char); if (last_char == '\r') tty_write(&lf, 1); --- 257,262 ---- char lf = '\n'; ! DEBUG_TTY("format_cr, last char was %x\n", last_char); ! if (last_char == '\r') tty_write(&lf, 1); *************** *** 179,183 **** int tty_set_escape_proc(int onoff) { - int oldval = interpret_escape; interpret_escape = onoff; --- 285,288 ---- *************** *** 192,197 **** void tty_echo_terminator(int a) { ! if (debug & 4) ! fprintf(stderr, "TTY: echo terminators = %d\n", a); echo_terminator = a; --- 297,301 ---- void tty_echo_terminator(int a) { ! DEBUG_TTY("echo terminators = %d\n", a); echo_terminator = a; *************** *** 200,205 **** void tty_set_default_terminators() { ! if (debug & 4) ! fprintf(stderr, "TTY: set default terminators\n"); /* All control chars except ^R ^U ^W, BS & HT */ --- 304,308 ---- void tty_set_default_terminators() { ! DEBUG_TTY("set default terminators\n"); /* All control chars except ^R ^U ^W, BS & HT */ *************** *** 216,226 **** void tty_set_terminators(char *buf, int len) { ! if (debug & 4) { int i; ! fprintf(stderr, "TTY: set terminators... %d bytes\n", len); ! fprintf(stderr, "TTY: terms: "); for (i=0; i<len; i++) ! fprintf(stderr, "%02x ", buf[i]); ! fprintf(stderr, "\n"); } memset(terminators, 0, sizeof(terminators)); --- 319,329 ---- void tty_set_terminators(char *buf, int len) { ! if (debug & DEBUG_FLAG_TTY) { int i; ! DEBUG_TTY("set terminators... %d bytes\n", len); ! DEBUG_TTY("terms: "); for (i=0; i<len; i++) ! DEBUGLOG(DEBUG_FLAG_TTY, "%02x ", buf[i]); ! DEBUGLOG(DEBUG_FLAG_TTY, "\n"); } memset(terminators, 0, sizeof(terminators)); *************** *** 231,237 **** { int i; ! if (debug & 4) ! fprintf(stderr, "TTY: start_read promptlen = %d, maxlen=%d\n", ! promptlen, len); if (promptlen) tty_write(prompt, promptlen); if (len < 0) len = sizeof(input_buf); --- 334,340 ---- { int i; ! DEBUG_TTY("start_read promptlen = %d, maxlen=%d\n", ! promptlen, len); ! if (promptlen) tty_write(prompt, promptlen); if (len < 0) len = sizeof(input_buf); *************** *** 242,246 **** prompt_len = promptlen; ! /* Work out the position of the cursor after the prompt (which may contain CRLF chars ) */ line_start_pos = 0; for (i = 0; i<prompt_len; i++) --- 345,349 ---- prompt_len = promptlen; ! /* Work out the position of the cursor after the prompt (which may contain CRLF chars) */ line_start_pos = 0; for (i = 0; i<prompt_len; i++) *************** *** 260,265 **** int copylen = rahead_len; ! if (debug & 4) ! fprintf(stderr, "TTY: readahead = %d bytes\n", rahead_len); /* Don't overflow the input buffer */ --- 363,367 ---- int copylen = rahead_len; ! DEBUG_TTY("readahead = %d bytes\n", rahead_len); /* Don't overflow the input buffer */ *************** *** 268,273 **** rahead_len -= copylen; tty_process_terminal(rahead_buf, copylen); ! if (debug & 4) ! fprintf(stderr, "TTY: readahead now = %d bytes\n", rahead_len); } } --- 370,374 ---- rahead_len -= copylen; tty_process_terminal(rahead_buf, copylen); ! DEBUG_TTY("readahead now = %d bytes\n", rahead_len); } } *************** *** 286,293 **** void tty_set_maxlen(unsigned short len) { max_read_len = len; - if (debug & 4) - fprintf(stderr, "TTY: max_read_len now = %d \n", len); - } --- 387,392 ---- void tty_set_maxlen(unsigned short len) { + DEBUG_TTY("max_read_len now = %d \n", len); max_read_len = len; } *************** *** 335,341 **** msk = (1 << aux); ! if (debug & 4) ! fprintf(stderr, "TTY: is_terminator: %d: (byte=%x, msk=%x) %s\n", c, terminators[termind],msk, ! (terminators[termind] & msk)?"Yes":"No"); if (terminators[termind] & msk) --- 434,439 ---- msk = (1 << aux); ! DEBUG_TTY("is_terminator: %d: (byte=%x, msk=%x) %s\n", c, terminators[termind],msk, ! (terminators[termind] & msk)?"Yes":"No"); if (terminators[termind] & msk) *************** *** 449,453 **** { esc_buf[esc_len++] = buf[i]; ! if (isalpha(buf[i]) || buf[i] == '~') { int esc_done = 0; --- 547,551 ---- { esc_buf[esc_len++] = buf[i]; ! if (!parse_escape(buf[i], &esc_state)) { int esc_done = 0; |
From: Patrick C. <pa...@us...> - 2006-03-21 08:38:50
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22418 Modified Files: Makefile cterm.c tty.c Log Message: Some better new line handling Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** Makefile 21 Oct 2005 12:13:17 -0000 1.5 --- Makefile 21 Mar 2006 08:38:42 -0000 1.6 *************** *** 17,21 **** $(PROG1): $(PROG1OBJS) tty.h dnlogin.h $(DEPLIBDNET) ! $(CC) -o $@ $(PROG1OBJS) $(LIBDNET) install: --- 17,21 ---- $(PROG1): $(PROG1OBJS) tty.h dnlogin.h $(DEPLIBDNET) ! $(CC) $(LDFLAGS) -o $@ $(PROG1OBJS) $(LIBDNET) install: Index: cterm.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/cterm.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** cterm.c 15 Mar 2006 14:21:34 -0000 1.24 --- cterm.c 21 Mar 2006 08:38:42 -0000 1.25 *************** *** 1,4 **** /****************************************************************************** ! (c) 2002-2005 P.J. Caulfield pa...@de... Portions based on code (c) 2000 Eduardo M Serrat --- 1,4 ---- /****************************************************************************** ! (c) 2002-2006 P.J. Caulfield pa...@de... Portions based on code (c) 2000 Eduardo M Serrat *************** *** 13,18 **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ****************************************************************************** ! */ #include <stdio.h> --- 13,17 ---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! *******************************************************************************/ #include <stdio.h> *************** *** 125,128 **** --- 124,148 ---- char char_attr[256]; + static int skip_next_lf; + + static void skip_first_lf(char *buf, int len) + { + int i; + int skipped = 0; + + for (i=0; i<len; i++) + { + if (buf[i] == '\n') + { + buf[i] = '\0'; + skipped = 1; + if (debug & 2) + fprintf(stderr, "PJC: skipping this LF\n"); + break; + } + } + if (skipped) + skip_next_lf = 0; + } /* Process incoming CTERM messages */ *************** *** 200,205 **** if (flags & 0x800) tty_set_noecho(); ! // PJC: The inclusion of the prompt len in here fixes TPU but is is right??? ! if (flags & 0x8 && buf[ptr+1] != '\n' && eoprompt > 0) tty_format_cr(); --- 220,224 ---- if (flags & 0x800) tty_set_noecho(); ! if (flags & 0x8 && buf[ptr+1] != '\n') tty_format_cr(); *************** *** 214,217 **** --- 233,241 ---- tty_echo_terminator((flags>>12)&1); + if (skip_next_lf) + { + skip_first_lf(buf+ptr+term_len, eoprompt); + } + /* do the biz */ tty_start_read(buf+ptr+term_len, len-term_len-ptr, eoprompt); *************** *** 251,256 **** tty_write(&feed, 1); feed = '\n'; ! for (i=0; i<data; i++) tty_write(&feed, 1); } if (flag == 2) --- 275,281 ---- tty_write(&feed, 1); feed = '\n'; ! for (i=0; i<data - skip_next_lf; i++) tty_write(&feed, 1); + skip_next_lf = 0; } if (flag == 2) *************** *** 283,292 **** send_prepostfix(((flags >> 6) & 3), prefixdata); //PP tty_write(buf+4, len-4); if ((flags >>2)&1) ! tty_write(&feed, 1); send_prepostfix(((flags >> 8) & 3), postfixdata); //QQ return len; } --- 308,337 ---- send_prepostfix(((flags >> 6) & 3), prefixdata); //PP + if (skip_next_lf) + { + skip_first_lf(buf+4, len-4); + } + tty_write(buf+4, len-4); if ((flags >>2)&1) ! { ! if (!skip_next_lf) ! { ! if (debug & 2) ! fprintf(stderr, "PJC: sending feed, skipping next LF\n"); ! tty_write(&feed, 1); ! skip_next_lf = 1; ! } ! else ! { ! if (debug & 2) ! fprintf(stderr, "PJC: NOT sending feed, skip_next_lf set\n"); ! skip_next_lf = 0; ! } ! } send_prepostfix(((flags >> 8) & 3), postfixdata); //QQ + return len; } Index: tty.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** tty.c 15 Mar 2006 14:21:34 -0000 1.28 --- tty.c 21 Mar 2006 08:38:42 -0000 1.29 *************** *** 1,4 **** /****************************************************************************** ! (c) 2002-2005 P.J. Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2002-2006 P.J. Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 11,16 **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ****************************************************************************** ! */ #include <stdio.h> --- 11,15 ---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! *******************************************************************************/ #include <stdio.h> *************** *** 98,101 **** --- 97,102 ---- int tty_write(char *buf, int len) { + int in_esc = 0; /* escapes can't stradde writes ??? */ + if (discard) return len; *************** *** 107,111 **** --- 108,115 ---- /* FF is a special case (perhaps!) */ if (len == 1 && buf[0] == '\f') + { + last_char = '\f'; return write(termfd, "\033[H\033[2J", 7); + } if (debug & 16) *************** *** 117,124 **** fprintf(stderr, "\n"); } write(termfd, buf, len); if (len) { ! last_char = buf[len-1]; if (debug & 4) fprintf(stderr, "TTY: Setting last_char to %02x\n", last_char); --- 121,139 ---- fprintf(stderr, "\n"); } + write(termfd, buf, len); + if (len) { ! int i; ! for (i=0; i<len; i++) ! { ! if (buf[i] == ESC) ! in_esc = 1; ! if (!in_esc && buf[i]) ! last_char = buf[i]; ! if (in_esc && (isalpha(buf[i]) || buf[i] == '~' || buf[i] == '>')) ! in_esc = 0; ! } if (debug & 4) fprintf(stderr, "TTY: Setting last_char to %02x\n", last_char); |
From: Patrick C. <pa...@us...> - 2006-03-17 15:06:28
|
Update of /cvsroot/linux-decnet/dnprogs/phone In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12610 Modified Files: phone_ncurses.c Log Message: Don't cast ints to chars, it breaks on big-endian machines. Index: phone_ncurses.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/phone/phone_ncurses.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** phone_ncurses.c 26 Jan 2006 14:55:01 -0000 1.6 --- phone_ncurses.c 17 Mar 2006 15:06:21 -0000 1.7 *************** *** 177,181 **** for (i=1; i<num_users; i++) { ! send_data(userinfo[i].out_fd, (char *)&key, 1); } return 0; --- 177,182 ---- for (i=1; i<num_users; i++) { ! char keychar = key; ! send_data(userinfo[i].out_fd, (char *)&keychar, 1); } return 0; |
From: Patrick C. <pa...@us...> - 2006-03-17 14:44:34
|
Update of /cvsroot/linux-decnet/dnprogs/dnroute In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2294 Modified Files: get_neigh.c Log Message: Make it work on bigendian boxes. Index: get_neigh.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/get_neigh.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** get_neigh.c 26 Jul 2003 09:45:43 -0000 1.5 --- get_neigh.c 17 Mar 2006 14:44:30 -0000 1.6 *************** *** 41,44 **** --- 41,45 ---- #endif + #include "dn_endian.h" #include "utils.h" #include "libnetlink.h" *************** *** 156,160 **** (addr[1] != exec_addr->a_addr[1])) { ! add_route(faddr, interface); } } --- 157,161 ---- (addr[1] != exec_addr->a_addr[1])) { ! add_route(dn_htons(faddr), interface); } } |
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32345 Modified Files: circuit.h localport.h server.h services.h circuit.cc clientsession.cc connection.cc interfaces-linux.cc latcp.cc latcpcircuit.cc llogin.cc llogincircuit.cc lloginsession.cc localport.cc localportsession.cc main.cc queuedsession.cc reversesession.cc server.cc serversession.cc services.cc session.cc Log Message: Use up-to-date C++ string/stream features. This gets rid of the annoying "deprecated" messages. Index: circuit.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/circuit.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** circuit.h 9 Feb 2001 19:59:50 -0000 1.1 --- circuit.h 17 Mar 2006 13:37:40 -0000 1.2 *************** *** 26,29 **** int fd; ! bool send_reply(int, char *, int); }; --- 26,29 ---- int fd; ! bool send_reply(int, const char *, int); }; Index: localport.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/localport.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** localport.h 21 Feb 2002 16:16:03 -0000 1.4 --- localport.h 17 Mar 2006 13:37:40 -0000 1.5 *************** *** 26,30 **** void restart_pty(); int get_port_fd(); ! void show_info(bool verbose, std::ostrstream &output); void close_and_delete(); const std::string &get_devname() { return devname; }; --- 26,30 ---- void restart_pty(); int get_port_fd(); ! void show_info(bool verbose, std::ostringstream &output); void close_and_delete(); const std::string &get_devname() { return devname; }; Index: server.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.h,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -r1.45 -r1.46 *** server.h 21 May 2005 14:21:46 -0000 1.45 --- server.h 17 Mar 2006 13:37:40 -0000 1.46 *************** *** 121,125 **** void read_latcp(int); void read_llogin(int); ! void print_bitmap(std::ostrstream &, bool, unsigned char *bitmap); void tidy_dev_directory(); int make_connection(int fd, const char *, const char *, const char *, const char *, const char *, bool); --- 121,125 ---- void read_latcp(int); void read_llogin(int); ! void print_bitmap(std::ostringstream &, bool, unsigned char *bitmap); void tidy_dev_directory(); int make_connection(int fd, const char *, const char *, const char *, const char *, const char *, bool); *************** *** 300,305 **** void set_nodename(unsigned char *); void unlock(); ! bool show_characteristics(bool verbose, std::ostrstream &output); ! bool show_nodes(bool verbose, std::ostrstream &output); int create_local_port(unsigned char *, unsigned char *, unsigned char *, unsigned char *, bool, bool, --- 300,305 ---- void set_nodename(unsigned char *); void unlock(); ! bool show_characteristics(bool verbose, std::ostringstream &output); ! bool show_nodes(bool verbose, std::ostringstream &output); int create_local_port(unsigned char *, unsigned char *, unsigned char *, unsigned char *, bool, bool, Index: services.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/services.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** services.h 6 Mar 2006 17:00:50 -0000 1.11 --- services.h 17 Mar 2006 13:37:40 -0000 1.12 *************** *** 40,47 **** bool remove_node(const std::string &node); ! bool list_services(bool verbose, std::ostrstream &output); void purge() {servicelist.clear(); } void expire_nodes(); ! bool list_dummy_nodes(bool verbose, std::ostrstream &output); bool touch_dummy_node_respond_counter(const std::string &str_name); --- 40,47 ---- bool remove_node(const std::string &node); ! bool list_services(bool verbose, std::ostringstream &output); void purge() {servicelist.clear(); } void expire_nodes(); ! bool list_dummy_nodes(bool verbose, std::ostringstream &output); bool touch_dummy_node_respond_counter(const std::string &str_name); *************** *** 76,82 **** bool is_available(); bool remove_node(const std::string &node); ! void list_service(std::ostrstream &output); void expire_nodes(time_t); ! void list_nodes(std::ostrstream &output); bool touch_dummy_node_respond_counter(const std::string &str_name); --- 76,82 ---- bool is_available(); bool remove_node(const std::string &node); ! void list_service(std::ostringstream &output); void expire_nodes(time_t); ! void list_nodes(std::ostringstream &output); bool touch_dummy_node_respond_counter(const std::string &str_name); Index: circuit.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/circuit.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** circuit.cc 21 Feb 2003 15:18:54 -0000 1.3 --- circuit.cc 17 Mar 2006 13:37:40 -0000 1.4 *************** *** 17,21 **** #include <unistd.h> ! #include <strstream> #include <list> #include <string> --- 17,21 ---- #include <unistd.h> ! #include <sstream> #include <list> #include <string> *************** *** 36,40 **** ! bool Circuit::send_reply(int cmd, char *buf, int len) { char outhead[3]; --- 36,40 ---- ! bool Circuit::send_reply(int cmd, const char *buf, int len) { char outhead[3]; Index: clientsession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/clientsession.cc,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** clientsession.cc 20 Dec 2003 16:36:31 -0000 1.27 --- clientsession.cc 17 Mar 2006 13:37:40 -0000 1.28 *************** *** 24,28 **** #include <string> #include <map> ! #include <strstream> #include "lat.h" --- 24,28 ---- #include <string> #include <map> ! #include <sstream> #include "lat.h" Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -r1.69 -r1.70 *** connection.cc 5 Mar 2005 11:22:37 -0000 1.69 --- connection.cc 17 Mar 2006 13:37:40 -0000 1.70 *************** *** 20,24 **** #include <queue> #include <string> ! #include <strstream> #include <iterator> --- 20,24 ---- #include <queue> #include <string> ! #include <sstream> #include <iterator> Index: interfaces-linux.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces-linux.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** interfaces-linux.cc 17 Mar 2006 09:41:29 -0000 1.10 --- interfaces-linux.cc 17 Mar 2006 13:37:40 -0000 1.11 *************** *** 55,61 **** #include <map> #include <string> ! #include <algo.h> #include <iterator> ! #include <strstream> #include <iomanip> --- 55,61 ---- #include <map> #include <string> ! #include <algorithm> #include <iterator> ! #include <sstream> #include <iomanip> Index: latcp.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcp.cc,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -r1.43 -r1.44 *** latcp.cc 6 Mar 2005 13:36:36 -0000 1.43 --- latcp.cc 17 Mar 2006 13:37:40 -0000 1.44 *************** *** 46,53 **** #include <map> #include <string> ! #include <algo.h> #include <iterator> #include <string> ! #include <strstream> #include "lat.h" --- 46,54 ---- #include <map> #include <string> ! #include <algorithm> #include <iterator> #include <string> ! #include <sstream> ! #include <iostream> #include "lat.h" *************** *** 247,253 **** if (!read_reply(latcp_socket, cmd, result, len)) { ! cout << result; ! delete[] result; } return; --- 248,254 ---- if (!read_reply(latcp_socket, cmd, result, len)) { ! std::cout << result; ! delete[] result; } return; *************** *** 269,275 **** if (!read_reply(latcp_socket, cmd, result, len)) { ! cout << result; ! delete[] result; } } --- 270,276 ---- if (!read_reply(latcp_socket, cmd, result, len)) { ! std::cout << result; ! delete[] result; } } Index: latcpcircuit.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcpcircuit.cc,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** latcpcircuit.cc 6 Mar 2005 14:05:51 -0000 1.26 --- latcpcircuit.cc 17 Mar 2006 13:37:40 -0000 1.27 *************** *** 17,21 **** #include <unistd.h> ! #include <strstream> #include <list> #include <string> --- 17,21 ---- #include <unistd.h> ! #include <sstream> #include <list> #include <string> *************** *** 98,108 **** { int verbose = cmdbuf[0]; ! std::ostrstream st; debuglog(("latcp: show_services(verbose=%d)\n", verbose)); LATServices::Instance()->list_services(verbose?true:false, st); ! send_reply(LATCP_SHOWSERVICE, st.str(), st.pcount()); ! st.freeze(false); } break; --- 98,108 ---- { int verbose = cmdbuf[0]; ! std::ostringstream st; debuglog(("latcp: show_services(verbose=%d)\n", verbose)); LATServices::Instance()->list_services(verbose?true:false, st); ! send_reply(LATCP_SHOWSERVICE, st.str().c_str(), (int)st.tellp()); ! // st.freeze(false); } break; *************** *** 111,121 **** { int verbose = cmdbuf[0]; ! std::ostrstream st; debuglog(("latcp: show_characteristics(verbose=%d)\n", verbose)); LATServer::Instance()->show_characteristics(verbose?true:false, st); ! send_reply(LATCP_SHOWCHAR, st.str(), st.pcount()); ! st.freeze(false); } break; --- 111,121 ---- { int verbose = cmdbuf[0]; ! std::ostringstream st; debuglog(("latcp: show_characteristics(verbose=%d)\n", verbose)); LATServer::Instance()->show_characteristics(verbose?true:false, st); ! send_reply(LATCP_SHOWCHAR, st.str().c_str(), (int)st.tellp()); ! // st.freeze(false); } break; *************** *** 124,134 **** { int verbose = cmdbuf[0]; ! std::ostrstream st; debuglog(("latcp: shownodes\n")); LATServer::Instance()->show_nodes(verbose?true:false, st); ! send_reply(LATCP_SHOWNODES, st.str(), st.pcount()); ! st.freeze(false); } break; --- 124,134 ---- { int verbose = cmdbuf[0]; ! std::ostringstream st; debuglog(("latcp: shownodes\n")); LATServer::Instance()->show_nodes(verbose?true:false, st); ! send_reply(LATCP_SHOWNODES, st.str().c_str(), (int)st.tellp()); ! // st.freeze(false); } break; Index: llogin.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogin.cc,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** llogin.cc 15 Mar 2006 13:36:11 -0000 1.23 --- llogin.cc 17 Mar 2006 13:37:40 -0000 1.24 *************** *** 47,54 **** #include <map> #include <string> ! #include <algo.h> #include <iterator> #include <string> ! #include <strstream> #include "lat.h" --- 47,55 ---- #include <map> #include <string> ! #include <algorithm> #include <iterator> #include <string> ! #include <sstream> ! #include <iostream> #include "lat.h" *************** *** 240,244 **** read_reply(latcp_socket, cmd, result, len); ! cout << result; delete[] result; --- 241,245 ---- read_reply(latcp_socket, cmd, result, len); ! std::cout << result; delete[] result; Index: llogincircuit.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogincircuit.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** llogincircuit.cc 17 Mar 2006 09:41:10 -0000 1.10 --- llogincircuit.cc 17 Mar 2006 13:37:40 -0000 1.11 *************** *** 18,22 **** #include <time.h> ! #include <strstream> #include <list> #include <string> --- 18,22 ---- #include <time.h> ! #include <sstream> #include <list> #include <string> *************** *** 102,112 **** { int verbose = cmdbuf[0]; ! std::ostrstream st; debuglog(("llogin: show_services(verbose=%d)\n", verbose)); LATServices::Instance()->list_services(verbose?true:false, st); ! send_reply(LATCP_SHOWSERVICE, st.str(), st.pcount()); ! st.freeze(false); } break; --- 102,112 ---- { int verbose = cmdbuf[0]; ! std::ostringstream st; debuglog(("llogin: show_services(verbose=%d)\n", verbose)); LATServices::Instance()->list_services(verbose?true:false, st); ! send_reply(LATCP_SHOWSERVICE, st.str().c_str(), (int)st.tellp()); ! // st.freeze(false); } break; Index: lloginsession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/lloginsession.cc,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** lloginsession.cc 13 Feb 2002 16:59:13 -0000 1.12 --- lloginsession.cc 17 Mar 2006 13:37:40 -0000 1.13 *************** *** 23,27 **** #include <string> #include <map> ! #include <strstream> #include "lat.h" --- 23,27 ---- #include <string> #include <map> ! #include <sstream> #include "lat.h" Index: localport.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/localport.cc,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** localport.cc 13 Aug 2004 07:56:43 -0000 1.14 --- localport.cc 17 Mar 2006 13:37:40 -0000 1.15 *************** *** 23,27 **** #include <string> #include <map> ! #include <strstream> #include <iomanip> --- 23,27 ---- #include <string> #include <map> ! #include <sstream> #include <iomanip> *************** *** 235,239 **** // Show info for latcp ! void LocalPort::show_info(bool verbose, std::ostrstream &output) { output.setf(std::ios::left, std::ios::adjustfield); --- 235,239 ---- // Show info for latcp ! void LocalPort::show_info(bool verbose, std::ostringstream &output) { output.setf(std::ios::left, std::ios::adjustfield); Index: localportsession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/localportsession.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** localportsession.cc 13 Aug 2004 07:56:43 -0000 1.6 --- localportsession.cc 17 Mar 2006 13:37:40 -0000 1.7 *************** *** 28,32 **** #include <string> #include <map> ! #include <strstream> #include "lat.h" --- 28,32 ---- #include <string> #include <map> ! #include <sstream> #include "lat.h" Index: main.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/main.cc,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** main.cc 15 Mar 2003 14:08:45 -0000 1.21 --- main.cc 17 Mar 2006 13:37:40 -0000 1.22 *************** *** 42,46 **** #include <map> #include <iterator> ! #include <strstream> #include "lat.h" --- 42,46 ---- #include <map> #include <iterator> ! #include <sstream> #include "lat.h" Index: queuedsession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/queuedsession.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** queuedsession.cc 11 Feb 2002 16:39:34 -0000 1.3 --- queuedsession.cc 17 Mar 2006 13:37:40 -0000 1.4 *************** *** 24,28 **** #include <string> #include <map> ! #include <strstream> #include "lat.h" --- 24,28 ---- #include <string> #include <map> ! #include <sstream> #include "lat.h" Index: reversesession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/reversesession.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** reversesession.cc 5 Apr 2003 14:30:18 -0000 1.3 --- reversesession.cc 17 Mar 2006 13:37:40 -0000 1.4 *************** *** 27,31 **** #include <string> #include <map> ! #include <strstream> #include "lat.h" --- 27,31 ---- #include <string> #include <map> ! #include <sstream> #include "lat.h" Index: server.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.cc,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -r1.82 -r1.83 *** server.cc 21 May 2005 14:21:46 -0000 1.82 --- server.cc 17 Mar 2006 13:37:40 -0000 1.83 *************** *** 46,52 **** #include <map> #include <string> ! #include <algo.h> #include <iterator> ! #include <strstream> #include <iomanip> --- 46,52 ---- #include <map> #include <string> ! #include <algorithm> #include <iterator> ! #include <sstream> #include <iomanip> *************** *** 1846,1850 **** // Make this as much like VMS LATCP SHOW NODE as possible. ! bool LATServer::show_characteristics(bool verbose, std::ostrstream &output) { output <<std::endl; --- 1846,1850 ---- // Make this as much like VMS LATCP SHOW NODE as possible. ! bool LATServer::show_characteristics(bool verbose, std::ostringstream &output) { output <<std::endl; *************** *** 1902,1911 **** // NUL-terminate it. ! output << std::endl << ends; return true; } ! bool LATServer::show_nodes(bool verbose, std::ostrstream &output) { return LATServices::Instance()->list_dummy_nodes(verbose, output); --- 1902,1911 ---- // NUL-terminate it. ! output << std::endl << std::ends; return true; } ! bool LATServer::show_nodes(bool verbose, std::ostringstream &output) { return LATServices::Instance()->list_dummy_nodes(verbose, output); *************** *** 2008,2012 **** // Print a groups bitmap // TODO: print x-y format like we accept in latcp. ! void LATServer::print_bitmap(std::ostrstream &output, bool isset, unsigned char *bitmap) { if (!isset) --- 2008,2012 ---- // Print a groups bitmap // TODO: print x-y format like we accept in latcp. ! void LATServer::print_bitmap(std::ostringstream &output, bool isset, unsigned char *bitmap) { if (!isset) Index: serversession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/serversession.cc,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** serversession.cc 28 May 2003 15:56:08 -0000 1.19 --- serversession.cc 17 Mar 2006 13:37:40 -0000 1.20 *************** *** 28,32 **** #include <string> #include <map> ! #include <strstream> #include "lat.h" --- 28,32 ---- #include <string> #include <map> ! #include <sstream> #include "lat.h" Index: services.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/services.cc,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** services.cc 4 Jan 2004 15:49:04 -0000 1.16 --- services.cc 17 Mar 2006 13:37:40 -0000 1.17 *************** *** 22,26 **** #include <map> #include <iterator> ! #include <strstream> #include <iomanip> --- 22,26 ---- #include <map> #include <iterator> ! #include <sstream> #include <iomanip> *************** *** 224,228 **** // Verbose listing of nodes in this service ! void LATServices::serviceinfo::list_service(std::ostrstream &output) { std::map<std::string, nodeinfo, std::less<std::string> >::iterator n(nodes.begin()); --- 224,228 ---- // Verbose listing of nodes in this service ! void LATServices::serviceinfo::list_service(std::ostringstream &output) { std::map<std::string, nodeinfo, std::less<std::string> >::iterator n(nodes.begin()); *************** *** 242,246 **** } ! void LATServices::serviceinfo::list_nodes(std::ostrstream &output) { std::map<std::string, nodeinfo, std::less<std::string> >::iterator n(nodes.begin()); --- 242,246 ---- } ! void LATServices::serviceinfo::list_nodes(std::ostringstream &output) { std::map<std::string, nodeinfo, std::less<std::string> >::iterator n(nodes.begin()); *************** *** 272,276 **** } ! bool LATServices::list_dummy_nodes(bool verbose, std::ostrstream &output) { std::map<std::string, serviceinfo, std::less<std::string> >::iterator dummies = --- 272,276 ---- } ! bool LATServices::list_dummy_nodes(bool verbose, std::ostringstream &output) { std::map<std::string, serviceinfo, std::less<std::string> >::iterator dummies = *************** *** 320,324 **** // List all known services ! bool LATServices::list_services(bool verbose, std::ostrstream &output) { std::map<std::string, serviceinfo, std::less<std::string> >::iterator s(servicelist.begin()); --- 320,324 ---- // List all known services ! bool LATServices::list_services(bool verbose, std::ostringstream &output) { std::map<std::string, serviceinfo, std::less<std::string> >::iterator s(servicelist.begin()); Index: session.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/session.cc,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -r1.43 -r1.44 *** session.cc 5 Mar 2005 11:26:09 -0000 1.43 --- session.cc 17 Mar 2006 13:37:40 -0000 1.44 *************** *** 38,42 **** #include <map> #include <queue> ! #include <strstream> #include "lat.h" --- 38,42 ---- #include <map> #include <queue> ! #include <sstream> #include "lat.h" |
From: Patrick C. <pa...@us...> - 2006-03-17 09:45:14
|
Update of /cvsroot/linux-decnet/dnprogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2616 Modified Files: NEWS Log Message: Update NEWS Index: NEWS =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/NEWS,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** NEWS 30 Oct 2005 15:21:49 -0000 1.20 --- NEWS 17 Mar 2006 09:33:50 -0000 1.21 *************** *** 1,2 **** --- 1,26 ---- + dnprogs (2.34) unstable; urgency=low + + * Don't SIGBUS on sparc sending DAP packets > 255 bytes long + * Add -P & -D (print & delete) flags to dncopy + * Add zip files to fal -ae list of known filetypes + * dnlogin no loger loses spaces on ALLCAPS input + * dnlogin differentiates better betwwen ^C & ^Y when it needs to + + -- Patrick Caulfield <pa...@de...> Thu, 16 Mar 2006 14:40:45 +0000 + + dnprogs (2.33) unstable; urgency=low + + * Fix dncopy fetching from RSX (don't set RRL unless the user asks for it) + * Get rid of spurious protection error from dncopy + * dnlogin sets local username so (eg) VMSs SHOW TERM displays it + * Numerous fixes dnlogin so it now works to RSX + * Several fixes to fal so it works with RSX + * dnlogin now disconnects correctly when it gets a unbind + * ctermd: Fix "-bash: no job control in this shell" message on some platforms + * dndir displays more consistently (and once!) when a remote file is locked + * phone_ncurses now resizes the display if its xterm is resized + + -- Patrick Caulfield <pa...@de...> Thu, 26 Jan 2006 16:19:42 +0000 + dnprogs (2.32) unstable; urgency=low |
From: Patrick C. <pa...@us...> - 2006-03-17 09:45:09
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6167 Modified Files: interfaces-linux.cc Log Message: Listen for LAT solicit messages too. Index: interfaces-linux.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces-linux.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** interfaces-linux.cc 24 Mar 2004 16:53:53 -0000 1.9 --- interfaces-linux.cc 17 Mar 2006 09:41:29 -0000 1.10 *************** *** 274,277 **** --- 274,292 ---- } + /* This is the LAT solicit address */ + pack_info.mr_address[0] = 0x09; + pack_info.mr_address[1] = 0x00; + pack_info.mr_address[2] = 0x2b; + pack_info.mr_address[3] = 0x02; + pack_info.mr_address[4] = 0x01; + pack_info.mr_address[5] = 0x04; + + if (setsockopt(fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP, + &pack_info, sizeof(pack_info))) + { + syslog(LOG_ERR, "can't add lat socket multicast : %m\n"); + return -1; + } + return 0; } *************** *** 302,305 **** --- 317,336 ---- return -1; } + + /* This is the LAT solicit address */ + pack_info.mr_address[0] = 0x09; + pack_info.mr_address[1] = 0x00; + pack_info.mr_address[2] = 0x2b; + pack_info.mr_address[3] = 0x02; + pack_info.mr_address[4] = 0x01; + pack_info.mr_address[5] = 0x04; + + if (setsockopt(fd, SOL_PACKET, PACKET_DROP_MEMBERSHIP, + &pack_info, sizeof(pack_info))) + { + syslog(LOG_ERR, "can't remove socket multicast : %m\n"); + return -1; + } + return 0; } |
From: Patrick C. <pa...@us...> - 2006-03-17 09:45:09
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5859 Modified Files: llogincircuit.cc Log Message: Slightly better error messages Index: llogincircuit.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogincircuit.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** llogincircuit.cc 24 May 2003 13:26:11 -0000 1.9 --- llogincircuit.cc 17 Mar 2006 09:41:10 -0000 1.10 *************** *** 91,96 **** else { debuglog(("Connect from invalid llogin version %s\n", cmdbuf)); ! send_reply(LATCP_ERRORMSG, "llogin version does not match latd version " VERSION, -1); retval = false; } --- 91,98 ---- else { + char error[1024]; debuglog(("Connect from invalid llogin version %s\n", cmdbuf)); ! sprintf(error, "llogin version %s does not match latd version " VERSION, cmdbuf); ! send_reply(LATCP_ERRORMSG, error, -1); retval = false; } *************** *** 135,139 **** { debuglog(("sending failure back to llogin\n")); ! send_reply(LATCP_ERRORMSG, "Error creating client service.", -1); } else --- 137,141 ---- { debuglog(("sending failure back to llogin\n")); ! send_reply(LATCP_ERRORMSG, "Can't find LAT service.", -1); } else |
From: Patrick C. <pa...@us...> - 2006-03-16 14:55:28
|
Update of /cvsroot/linux-decnet/dnprogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2574 Modified Files: Makefile.common Log Message: 2.34 Index: Makefile.common =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/Makefile.common,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -r1.33 -r1.34 *** Makefile.common 26 Jan 2006 16:29:12 -0000 1.33 --- Makefile.common 16 Mar 2006 14:55:22 -0000 1.34 *************** *** 58,62 **** MAJOR_VERSION=2 ! MINOR_VERSION=33 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) --- 58,62 ---- MAJOR_VERSION=2 ! MINOR_VERSION=34 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) |
From: Patrick C. <pa...@us...> - 2006-03-16 14:55:28
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2574/debian Modified Files: changelog Log Message: 2.34 Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/changelog,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -r1.36 -r1.37 *** changelog 26 Jan 2006 16:29:13 -0000 1.36 --- changelog 16 Mar 2006 14:55:22 -0000 1.37 *************** *** 1,2 **** --- 1,12 ---- + dnprogs (2.34) unstable; urgency=low + + * Don't SIGBUS on sparc sending DAP packets > 255 bytes long + * Add -P & -D (print & delete) flags to dncopy + * Add zip files to fal -ae list of known filetypes + * dnlogin no loger loses spaces on ALLCAPS input + * dnlogin differentiates better betwwen ^C & ^Y when it needs to + + -- Patrick Caulfield <pa...@de...> Thu, 16 Mar 2006 14:40:45 +0000 + dnprogs (2.33) unstable; urgency=low |
From: Patrick C. <pa...@us...> - 2006-03-15 14:21:39
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11630 Modified Files: cterm.c tty.c Log Message: Differentiate between ^C & ^Y Index: cterm.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/cterm.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** cterm.c 10 Jan 2006 13:34:30 -0000 1.23 --- cterm.c 15 Mar 2006 14:21:34 -0000 1.24 *************** *** 707,711 **** if (char_attr[(int)oobchar] & 0x30) //TODO NAME! { ! if (oobchar == CTRL_C || oobchar == CTRL_Y) tty_write("\033[7m Interrupt \033[0m\n", 20); if (oobchar == CTRL_O) --- 707,713 ---- if (char_attr[(int)oobchar] & 0x30) //TODO NAME! { ! if (oobchar == CTRL_C) ! tty_write("\033[7m Cancel \033[0m\n", 17); ! if (oobchar == CTRL_Y) tty_write("\033[7m Interrupt \033[0m\n", 20); if (oobchar == CTRL_O) Index: tty.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** tty.c 11 Mar 2006 13:54:42 -0000 1.27 --- tty.c 15 Mar 2006 14:21:34 -0000 1.28 *************** *** 109,113 **** return write(termfd, "\033[H\033[2J", 7); ! if (debug & 16) { int i; --- 109,113 ---- return write(termfd, "\033[H\033[2J", 7); ! if (debug & 16) { int i; *************** *** 382,385 **** --- 382,390 ---- buf[i] = '\r'; + /* I don't really understand this, but it's needed to make ^C work + as ^Y at the VMS command-line */ + if (buf[i] == CTRL_C && (!char_attr[(int)buf[i]] & 3)) + buf[i] = CTRL_Y; + /* Check for OOB */ if (char_attr[(int)buf[i]] & 3) |
From: Patrick C. <pa...@us...> - 2006-03-15 13:36:25
|
Update of /cvsroot/linux-decnet/latd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21818 Modified Files: llogin.cc Log Message: Stop terminal driver sending too any CRs Index: llogin.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogin.cc,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** llogin.cc 19 Dec 2003 20:16:10 -0000 1.22 --- llogin.cc 15 Mar 2006 13:36:11 -0000 1.23 *************** *** 389,392 **** --- 389,394 ---- new_term.c_iflag |= IGNBRK; new_term.c_lflag &= ~ISIG; + new_term.c_oflag &= ~OCRNL; + new_term.c_oflag &= ~ONLCR; new_term.c_cc[VMIN] = 1; new_term.c_cc[VTIME] = 0; |
From: Patrick C. <pa...@us...> - 2006-03-14 15:33:30
|
Update of /cvsroot/linux-decnet/dnprogs/dnroute In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19124 Modified Files: dnroute.8 Log Message: Fix some typos Index: dnroute.8 =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnroute/dnroute.8,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** dnroute.8 4 May 2003 12:04:49 -0000 1.1 --- dnroute.8 14 Mar 2006 15:33:13 -0000 1.2 *************** *** 16,24 **** routing policy. .br ! .B dnetd reads polls the DECnet neighbour table and copies those entries into the internal routing tables, thus providing a simple (I can see that node, therefore I can route to it) routing system. For many sites this will be ! simple enough. it is still possible to add routes using the ip(8) command. .SH OPTIONS --- 16,24 ---- routing policy. .br ! .B dnroute reads polls the DECnet neighbour table and copies those entries into the internal routing tables, thus providing a simple (I can see that node, therefore I can route to it) routing system. For many sites this will be ! simple enough. It is still possible to add routes using the ip(8) command. .SH OPTIONS *************** *** 28,32 **** .TP .I "\-v" ! Verbose. The more of these there are the more verbose droute will be. .TP .I \-h \-? --- 28,32 ---- .TP .I "\-v" ! Verbose. The more of these there are the more verbose dnroute will be. .TP .I \-h \-? |
From: Patrick C. <pa...@us...> - 2006-03-11 13:54:46
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22844 Modified Files: tty.c Log Message: Don't lose spaces on uppercase-only input Index: tty.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** tty.c 24 Jan 2006 14:05:09 -0000 1.26 --- tty.c 11 Mar 2006 13:54:42 -0000 1.27 *************** *** 521,525 **** } ! if (convert_uppercase) buf[i] &= 0x5F; --- 521,525 ---- } ! if (convert_uppercase && isalpha(buf[i])) buf[i] &= 0x5F; |
From: Patrick C. <pa...@us...> - 2006-03-10 15:32:16
|
Update of /cvsroot/linux-decnet/dnprogs/dncopy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13315 Modified Files: dncopy.cc Log Message: Flags should be ORed Index: dncopy.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dncopy.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** dncopy.cc 10 Mar 2006 08:13:16 -0000 1.9 --- dncopy.cc 10 Mar 2006 15:32:04 -0000 1.10 *************** *** 463,467 **** case 'l': ! flags = file::FILE_FLAGS_RRL; break; --- 463,467 ---- case 'l': ! flags |= file::FILE_FLAGS_RRL; break; *************** *** 517,525 **** case 'P': ! flags = file::FILE_FLAGS_SPOOL; break; case 'D': ! flags = file::FILE_FLAGS_DELETE; break; --- 517,525 ---- case 'P': ! flags |= file::FILE_FLAGS_SPOOL; break; case 'D': ! flags |= file::FILE_FLAGS_DELETE; break; |
From: Patrick C. <pa...@us...> - 2006-03-10 13:22:34
|
Update of /cvsroot/linux-decnet/dnprogs/fal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4031 Modified Files: fal.8 task.cc Log Message: Add ZIP files to the list of auto file types use by -ae Index: fal.8 =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/fal.8,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** fal.8 17 Jul 2002 07:34:23 -0000 1.6 --- fal.8 10 Mar 2006 13:22:28 -0000 1.7 *************** *** 99,102 **** --- 99,103 ---- .save b 8192 .exe b 512 + .zip b 512 #Linux types .tar b 10240 Index: task.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/task.cc,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** task.cc 17 Jan 2006 11:29:22 -0000 1.18 --- task.cc 10 Mar 2006 13:22:28 -0000 1.19 *************** *** 1184,1187 **** --- 1184,1188 ---- .save b 8192\n\ .exe b 512\n\ + .zip b 512\n\ #Linux types\n\ .tar b 10240\n\ |
From: Patrick C. <pa...@us...> - 2006-03-10 08:13:46
|
Update of /cvsroot/linux-decnet/dnprogs/dncopy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32414 Modified Files: Makefile dncopy.1 dncopy.cc dnetfile.h dnetfile_dap.cc file.h Log Message: add -D & -P options to dncopy. Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Makefile 12 Aug 2004 09:17:32 -0000 1.3 --- Makefile 10 Mar 2006 08:13:16 -0000 1.4 *************** *** 13,17 **** $(PROG1): $(PROG1OBJS) $(DEPLIBS) ! $(CXX) -o $@ $(PROG1OBJS) $(LIBS) $(PROG2): $(PROG1) --- 13,17 ---- $(PROG1): $(PROG1OBJS) $(DEPLIBS) ! $(CXX) $(LDFLAGS) -o $@ $(PROG1OBJS) $(LIBS) $(PROG2): $(PROG1) Index: dncopy.1 =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dncopy.1,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** dncopy.1 1 Sep 2005 08:34:39 -0000 1.7 --- dncopy.1 10 Mar 2006 08:13:16 -0000 1.8 *************** *** 153,156 **** --- 153,164 ---- This option is ignored when copying from VMS. .TP + .I "\-P" + Queue the file for printing to SYS$PRINT when it arrives at the VMS end. + .TP + .I "\-D" + Delete the file when it is closed. This is only really useful in conjunction + with + .I -P. + .TP .I \-h \-? Displays help for using the command. Index: dncopy.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dncopy.cc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** dncopy.cc 5 Jan 2006 19:24:13 -0000 1.8 --- dncopy.cc 10 Mar 2006 08:13:16 -0000 1.9 *************** *** 38,42 **** int &rfm, int &rat, int &org, int &interactive, int &keep_version, int &user_bufsize, ! int &remove_cr, int &show_stats, int &verbose, int &rrl, char *protection); // Start here: --- 38,43 ---- int &rfm, int &rat, int &org, int &interactive, int &keep_version, int &user_bufsize, ! int &remove_cr, int &show_stats, int &verbose, ! int &flags, char *protection); // Start here: *************** *** 59,63 **** int remove_cr = 0; int show_stats = 0; ! int rrl = 0; char opt; char protection[255]={'\0'}; --- 60,65 ---- int remove_cr = 0; int show_stats = 0; ! int printfile = 0; ! int flags = 0; char opt; char protection[255]={'\0'}; *************** *** 85,89 **** rfm, rat,org, interactive, keep_version, user_bufsize, ! remove_cr, show_stats, verbose, rrl, protection); --- 87,91 ---- rfm, rat,org, interactive, keep_version, user_bufsize, ! remove_cr, show_stats, verbose, flags, protection); *************** *** 92,96 **** rfm, rat,org, interactive, keep_version, user_bufsize, ! remove_cr, show_stats, verbose, rrl, protection); // Work out the buffer size. The default for block transfers is 512 --- 94,98 ---- rfm, rat,org, interactive, keep_version, user_bufsize, ! remove_cr, show_stats, verbose, flags, protection); // Work out the buffer size. The default for block transfers is 512 *************** *** 153,157 **** // Set up the network links if necessary ! if (out->setup_link(bufsize, rfm, rat, org, 0)) { out->perror("Error setting up output link"); --- 155,159 ---- // Set up the network links if necessary ! if (out->setup_link(bufsize, rfm, rat, org, flags)) { out->perror("Error setting up output link"); *************** *** 178,182 **** } ! if (in->setup_link(bufsize, rfm, rat, org, rrl)) { in->perror("Error setting up input link"); --- 180,184 ---- } ! if (in->setup_link(bufsize, rfm, rat, org, flags)) { in->perror("Error setting up input link"); *************** *** 356,360 **** fprintf(f, " -b <n> use a block size of <n> bytes\n"); fprintf(f, " -d (s)remove trailing CR on record (DOS file transfer)\n"); ! fprintf(f, " -l (r)Ignore interlocks on remote file\n"); fprintf(f, " -V show version number\n"); fprintf(f, "\n"); --- 358,364 ---- fprintf(f, " -b <n> use a block size of <n> bytes\n"); fprintf(f, " -d (s)remove trailing CR on record (DOS file transfer)\n"); ! fprintf(f, " -l (r)ignore interlocks on remote file\n"); ! fprintf(f, " -P (s)print file to SYS$PRINT\n"); ! fprintf(f, " -D (s)delete file on close. Only really useful with -P\n"); fprintf(f, " -V show version number\n"); fprintf(f, "\n"); *************** *** 437,446 **** int &rfm, int &rat, int &org, int &interactive, int &keep_version, int &user_bufsize, ! int &remove_cr, int &show_stats, int &verbose, int &rrl, char *protection) { int opt; opterr = 0; optind = 0; ! while ((opt=getopt(argc,argv,"?Vvhdr:a:b:kislm:p:")) != EOF) { switch(opt) { --- 441,451 ---- int &rfm, int &rat, int &org, int &interactive, int &keep_version, int &user_bufsize, ! int &remove_cr, int &show_stats, int &verbose, ! int &flags, char *protection) { int opt; opterr = 0; optind = 0; ! while ((opt=getopt(argc,argv,"?Vvhdr:a:b:kislm:p:PD")) != EOF) { switch(opt) { *************** *** 458,462 **** case 'l': ! rrl = 1; break; --- 463,467 ---- case 'l': ! flags = file::FILE_FLAGS_RRL; break; *************** *** 511,514 **** --- 516,527 ---- break; + case 'P': + flags = file::FILE_FLAGS_SPOOL; + break; + + case 'D': + flags = file::FILE_FLAGS_DELETE; + break; + case 'b': user_bufsize = atoi(optarg); Index: dnetfile.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dnetfile.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** dnetfile.h 1 Sep 2005 08:34:39 -0000 1.4 --- dnetfile.h 10 Mar 2006 08:13:16 -0000 1.5 *************** *** 50,54 **** int verbose; - /* File attributes, requested and actual */ int file_rat, file_rfm; --- 50,53 ---- Index: dnetfile_dap.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dnetfile_dap.cc,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** dnetfile_dap.cc 17 Jan 2006 11:33:54 -0000 1.11 --- dnetfile_dap.cc 10 Mar 2006 08:13:16 -0000 1.12 *************** *** 1,4 **** /****************************************************************************** ! (c) 1998-2005 P.J. Caulfield pa...@ty... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 1998-2006 P.J. Caulfield pa...@ty... This program is free software; you can redistribute it and/or modify *************** *** 94,98 **** att.set_mrs(0); att.set_datatype(dap_attrib_message::IMAGE); ! if (user_flags) { acc.set_shr(1<<dap_access_message::FB$PUT | 1<<dap_access_message::FB$UPD | --- 94,98 ---- att.set_mrs(0); att.set_datatype(dap_attrib_message::IMAGE); ! if (user_flags & FILE_FLAGS_RRL) { acc.set_shr(1<<dap_access_message::FB$PUT | 1<<dap_access_message::FB$UPD | *************** *** 223,227 **** ctl.set_ctlfunc(dap_control_message::PUT); } ! if (user_flags) { ctl.set_rop_bit(dap_control_message::RB$RRL); --- 223,227 ---- ctl.set_ctlfunc(dap_control_message::PUT); } ! if (user_flags & file::FILE_FLAGS_RRL) { ctl.set_rop_bit(dap_control_message::RB$RRL); *************** *** 236,239 **** --- 236,245 ---- dap_accomp_message accomp; accomp.set_cmpfunc(dap_accomp_message::CLOSE); + + /* Remote printing support */ + if (user_flags & FILE_FLAGS_SPOOL) + accomp.set_fop_bit(dap_attrib_message::FB$SPL); + if (user_flags & FILE_FLAGS_DELETE) + accomp.set_fop_bit(dap_attrib_message::FB$DLT); if (!accomp.write(conn)) return -1; conn.set_blocked(false); Index: file.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/file.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** file.h 1 Sep 2005 08:34:39 -0000 1.3 --- file.h 10 Mar 2006 08:13:16 -0000 1.4 *************** *** 37,41 **** virtual int max_buffersize(int biggest) = 0; virtual void set_protection(char *vmsprot) {}; ! // Some constants --- 37,41 ---- virtual int max_buffersize(int biggest) = 0; virtual void set_protection(char *vmsprot) {}; ! // Some constants *************** *** 58,62 **** static const int RFM_STMLF = 5; static const int RFM_STMCR = 6; ! private: // Disable copy constructor --- 58,67 ---- static const int RFM_STMLF = 5; static const int RFM_STMCR = 6; ! ! // user_flags passed to setup_link. ! static const int FILE_FLAGS_RRL = 1; ! static const int FILE_FLAGS_SPOOL = 2; ! static const int FILE_FLAGS_DELETE = 4; ! private: // Disable copy constructor |