linux-decnet-commit Mailing List for DECnet for Linux (Page 40)
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
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv2783 Modified Files: connection.cc connection.h latcp.cc latcpcircuit.cc llogin.1 llogin.cc localport.cc localport.h main.cc server.cc Log Message: Add ability to connect to passworded service to llogin. Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -r1.34 -r1.35 *** connection.cc 3 Jan 2002 09:45:17 -0000 1.34 --- connection.cc 8 Feb 2002 15:07:30 -0000 1.35 *************** *** 962,966 **** int LATConnection::create_localport_session(int fd, LocalPort *lport, const char *service, const char *port, ! const char *localport) { // Create a localportSession for a /dev/lat port --- 962,966 ---- int LATConnection::create_localport_session(int fd, LocalPort *lport, const char *service, const char *port, ! const char *localport, const char *password) { // Create a localportSession for a /dev/lat port Index: connection.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** connection.h 3 Jan 2002 09:45:17 -0000 1.19 --- connection.h 8 Feb 2002 15:07:30 -0000 1.20 *************** *** 44,48 **** int create_llogin_session(int, char *service, char *port, char *localport, char *password); int create_localport_session(int, class LocalPort *, const char *service, ! const char *port, const char *localport); int disconnect_client(); // From LATServer int got_connect_ack(unsigned char *); // Callback from LATServer --- 44,49 ---- int create_llogin_session(int, char *service, char *port, char *localport, char *password); int create_localport_session(int, class LocalPort *, const char *service, ! const char *port, const char *localport, ! const char *password); int disconnect_client(); // From LATServer int got_connect_ack(unsigned char *); // Callback from LATServer Index: latcp.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcp.cc,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** latcp.cc 3 Jan 2002 08:46:55 -0000 1.27 --- latcp.cc 8 Feb 2002 15:07:30 -0000 1.28 *************** *** 521,524 **** --- 521,525 ---- char remnode[255] = {'\0'}; char remservice[255] = {'\0'}; + char password[255] = {'\0'}; char command[1024] = {'\0'}; signed char opt; *************** *** 538,542 **** optind = 0; ! while ((opt=getopt(argc,argv,"a:i:p:H:R:V:r:sQ8C:m:u:")) != EOF) { switch(opt) --- 539,543 ---- optind = 0; ! while ((opt=getopt(argc,argv,"a:i:p:H:R:V:r:w:sQ8C:m:u:")) != EOF) { switch(opt) *************** *** 553,556 **** --- 554,561 ---- break; + case 'w': + strcpy(password, optarg); + break; + case 'p': got_port=true; *************** *** 665,668 **** --- 670,674 ---- message[ptr++] = queued; message[ptr++] = clean; + add_string((unsigned char*)message, &ptr, (unsigned char*)password); send_msg(latcp_socket, LATCP_ADDPORT, message, ptr); Index: latcpcircuit.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcpcircuit.cc,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** latcpcircuit.cc 3 Jan 2002 08:46:55 -0000 1.18 --- latcpcircuit.cc 8 Feb 2002 15:07:30 -0000 1.19 *************** *** 337,340 **** --- 337,341 ---- unsigned char localport[255]; unsigned char remnode[255]; + unsigned char password[255]; int ptr=0; *************** *** 345,348 **** --- 346,350 ---- bool queued = cmdbuf[ptr++]; bool clean = cmdbuf[ptr++]; + get_string((unsigned char*)cmdbuf, &ptr, password); debuglog(("latcp: add port: %s:%s (%s)\n", *************** *** 354,358 **** remnode, queued, ! clean) < 0) { debuglog(("sending failure back to LATCP\n")); --- 356,361 ---- remnode, queued, ! clean, ! password) < 0) { debuglog(("sending failure back to LATCP\n")); Index: llogin.1 =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogin.1,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** llogin.1 3 Jan 2002 15:59:57 -0000 1.8 --- llogin.1 8 Feb 2002 15:07:30 -0000 1.9 *************** *** 10,14 **** Options: .br ! [\-dvcpblhQ] [\-H node] [\-R port] [-n name] [-w password] [\-q quit char] .SH DESCRIPTION .PP --- 10,14 ---- Options: .br ! [\-dvcpblhQ] [\-H node] [\-R port] [-n name] [-w password | -W] [\-q quit char] .SH DESCRIPTION .PP *************** *** 75,78 **** --- 75,81 ---- for a password and it will not be echoed. This avoids having passwords visible on the screen. + .TP + .I "\-W" + Prompts for the service password. This is the same as -w- (see above). .TP .I "\-p" Index: llogin.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogin.cc,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** llogin.cc 3 Jan 2002 15:59:57 -0000 1.12 --- llogin.cc 8 Feb 2002 15:07:30 -0000 1.13 *************** *** 109,113 **** if (ttyname(0)) strcpy(localport, ttyname(0)); ! while ((opt=getopt(argc,argv,"dpcvhlbQH:R:r:q:n:w:")) != EOF) { switch(opt) --- 109,113 ---- if (ttyname(0)) strcpy(localport, ttyname(0)); ! while ((opt=getopt(argc,argv,"dpcvhlbQWH:R:r:q:n:w:")) != EOF) { switch(opt) *************** *** 154,157 **** --- 154,161 ---- case 'w': strcpy(password, optarg); + break; + + case 'W': + strcpy(password, "-"); break; Index: localport.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/localport.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** localport.cc 3 Jan 2002 08:46:55 -0000 1.2 --- localport.cc 8 Feb 2002 15:07:30 -0000 1.3 *************** *** 36,46 **** #include "lat_messages.h" ! LocalPort::LocalPort(unsigned char *_service, unsigned char *_portname, unsigned char *_devname, unsigned char *_remnode, ! bool _queued, bool _clean): service((char*)_service), portname((char*)_portname), devname((char*)_devname), remnode((char*)_remnode), queued(_queued), clean(_clean), --- 36,47 ---- #include "lat_messages.h" ! LocalPort::LocalPort(unsigned char *_service, unsigned char *_portname, unsigned char *_devname, unsigned char *_remnode, ! bool _queued, bool _clean, unsigned char *_password): service((char*)_service), portname((char*)_portname), devname((char*)_devname), remnode((char*)_remnode), + password((char*)_password), queued(_queued), clean(_clean), *************** *** 57,60 **** --- 58,62 ---- devname = p.devname; remnode = p.remnode; + password = p.password; queued = p.queued; clean = p.clean; *************** *** 81,93 **** tcgetattr(master_fd, &tio); tio.c_iflag |= IGNBRK|BRKINT; ! tio.c_oflag &= ~ONLCR; ! tio.c_oflag &= ~OCRNL; ! tio.c_iflag &= ~INLCR; ! tio.c_iflag &= ~ICRNL; tcsetattr(master_fd, TCSANOW, &tio); strcpy(ptyname, ttyname(slave_fd)); slave_fd_open = true; ! // Check for /dev/lat & create it if necessary struct stat st; --- 83,95 ---- tcgetattr(master_fd, &tio); tio.c_iflag |= IGNBRK|BRKINT; ! tio.c_oflag &= ~ONLCR; ! tio.c_oflag &= ~OCRNL; ! tio.c_iflag &= ~INLCR; ! tio.c_iflag &= ~ICRNL; tcsetattr(master_fd, TCSANOW, &tio); strcpy(ptyname, ttyname(slave_fd)); slave_fd_open = true; ! // Check for /dev/lat & create it if necessary struct stat st; *************** *** 136,148 **** debuglog(("LocalPort::restart_pty()\n")); connected = false; ! // Close it all down so the local side gets EOF unlink(devname.c_str()); ! if (slave_fd_open) close (slave_fd); close (master_fd); LATServer::Instance()->set_fd_state(master_fd, true); LATServer::Instance()->remove_fd(master_fd); ! // Now open it all up again ready for a new connection init_port(); --- 138,150 ---- debuglog(("LocalPort::restart_pty()\n")); connected = false; ! // Close it all down so the local side gets EOF unlink(devname.c_str()); ! if (slave_fd_open) close (slave_fd); close (master_fd); LATServer::Instance()->set_fd_state(master_fd, true); LATServer::Instance()->remove_fd(master_fd); ! // Now open it all up again ready for a new connection init_port(); *************** *** 154,158 **** { debuglog(("LocalPort::disconnect_session()\n")); ! // If the reason was some sort of error then send it to // the PTY if (reason >= 1) --- 156,160 ---- { debuglog(("LocalPort::disconnect_session()\n")); ! // If the reason was some sort of error then send it to // the PTY if (reason >= 1) *************** *** 172,179 **** bool LocalPort::connect_session() { ! return LATServer::Instance()->make_port_connection(master_fd, this, service.c_str(), remnode.c_str(), portname.c_str(), devname.c_str(), ! queued); } --- 174,181 ---- bool LocalPort::connect_session() { ! return LATServer::Instance()->make_port_connection(master_fd, this, service.c_str(), remnode.c_str(), portname.c_str(), devname.c_str(), ! password.c_str(), queued); } *************** *** 212,218 **** { output << devname << std::setw(24-devname.length()) << " " << service ! << std::setw(16-service.length()) << " " << remnode << std::setw(16-remnode.length()) << " " << portname ! << std::setw(16-portname.length()) << " " << (queued?"Yes":"No ") << (clean?" 8":" ") << std::endl; } --- 214,220 ---- { output << devname << std::setw(24-devname.length()) << " " << service ! << std::setw(16-service.length()) << " " << remnode << std::setw(16-remnode.length()) << " " << portname ! << std::setw(16-portname.length()) << " " << (queued?"Yes":"No ") << (clean?" 8":" ") << std::endl; } Index: localport.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/localport.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** localport.h 3 Jan 2002 08:46:55 -0000 1.2 --- localport.h 8 Feb 2002 15:07:30 -0000 1.3 *************** *** 17,22 **** public: LocalPort(unsigned char *service, unsigned char *portname, unsigned char *devname, ! unsigned char *remnode, ! bool queued, bool clean); LocalPort(const LocalPort &p); --- 17,21 ---- public: LocalPort(unsigned char *service, unsigned char *portname, unsigned char *devname, ! unsigned char *remnode, bool queued, bool clean, unsigned char *password); LocalPort(const LocalPort &p); *************** *** 40,43 **** --- 39,43 ---- std::string devname; std::string remnode; + std::string password; bool queued; bool clean; Index: main.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/main.cc,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** main.cc 3 Jan 2002 08:46:55 -0000 1.15 --- main.cc 8 Feb 2002 15:07:30 -0000 1.16 *************** *** 98,102 **** strcpy(service, (char *)LATServer::Instance()->get_local_node()); ! // Deal with command-line arguments. Do these before the check for root // so we can check the version number and get help without being root. --- 98,102 ---- strcpy(service, (char *)LATServer::Instance()->get_local_node()); ! // Deal with command-line arguments. Do these before the check for root // so we can check the version number and get help without being root. *************** *** 105,111 **** while ((opt=getopt(argc,argv,"?vVhdl:r:s:t:g:i:c:")) != EOF) { ! switch(opt) { ! case 'h': usage(argv[0], stdout); exit(0); --- 105,111 ---- while ((opt=getopt(argc,argv,"?vVhdl:r:s:t:g:i:c:")) != EOF) { ! switch(opt) { ! case 'h': usage(argv[0], stdout); exit(0); *************** *** 156,160 **** exit(1); break; ! case 'l': if (optarg[0] != 's' && --- 156,160 ---- exit(1); break; ! case 'l': if (optarg[0] != 's' && *************** *** 187,191 **** // Unset it so our children don't inherit it. unsetenv("LATCP_STARTED"); ! #ifndef NO_FORK if (!debug) // Also available at run-time --- 187,191 ---- // Unset it so our children don't inherit it. unsetenv("LATCP_STARTED"); ! #ifndef NO_FORK if (!debug) // Also available at run-time *************** *** 197,209 **** perror("server: can't fork"); exit(2); ! case 0: // child break; ! default: // Parent. if (verbosity > 1) printf("server: forked process %d\n", pid); ! exit(0); } ! // Detach ourself from the calling environment int devnull = open("/dev/null", O_RDWR); --- 197,209 ---- perror("server: can't fork"); exit(2); ! case 0: // child break; ! default: // Parent. if (verbosity > 1) printf("server: forked process %d\n", pid); ! exit(0); } ! // Detach ourself from the calling environment int devnull = open("/dev/null", O_RDWR); *************** *** 218,225 **** } #endif ! struct sigaction siga; sigset_t ss; ! sigemptyset(&ss); siga.sa_handler=sigchild; --- 218,225 ---- } #endif ! struct sigaction siga; sigset_t ss; ! sigemptyset(&ss); siga.sa_handler=sigchild; *************** *** 239,243 **** signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); ! openlog("latd", LOG_PID, LOG_DAEMON); --- 239,243 ---- signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); ! openlog("latd", LOG_PID, LOG_DAEMON); *************** *** 247,251 **** interfaces, verbosity, circuit_timer); server->run(); ! return 0; } --- 247,251 ---- interfaces, verbosity, circuit_timer); server->run(); ! return 0; } *************** *** 258,264 **** // Make sure we reap all children ! do ! { ! pid = waitpid(-1, &status, WNOHANG); } while (pid > 0); --- 258,264 ---- // Make sure we reap all children ! do ! { ! pid = waitpid(-1, &status, WNOHANG); } while (pid > 0); Index: server.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.cc,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -r1.47 -r1.48 *** server.cc 3 Jan 2002 09:45:17 -0000 1.47 --- server.cc 8 Feb 2002 15:07:30 -0000 1.48 *************** *** 37,53 **** #include <assert.h> #include <netinet/in.h> - #include <features.h> /* for the glibc version number */ - #if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || __GLIBC__ >= 3 - #include <netpacket/packet.h> - #include <net/ethernet.h> /* the L2 protocols */ - #include <net/if_arp.h> - #include <linux/if.h> - #else - #include <asm/types.h> - #include <linux/if.h> - #include <linux/if_arp.h> - #include <linux/if_packet.h> - #include <linux/if_ether.h> /* The L2 protocols */ - #endif #include <list> --- 37,40 ---- *************** *** 70,164 **** #include "server.h" #include "services.h" #include "lat_messages.h" #include "dn_endian.h" - - // Get all ethernet interfaces - void LATServer::get_all_interfaces() - { - struct ifreq ifr; - int iindex = 1; - - int sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); - num_interfaces = 0; - - ifr.ifr_ifindex = iindex; - - while (ioctl(sock, SIOCGIFNAME, &ifr) == 0) - { - // Only use ethernet interfaces - ioctl(sock, SIOCGIFHWADDR, &ifr); - if (ifr.ifr_hwaddr.sa_family == ARPHRD_ETHER) - { - debuglog(("interface %d: %d\n", num_interfaces, iindex)); - interface_num[num_interfaces++] = iindex; - } - ifr.ifr_ifindex = ++iindex; - } - - close(sock); - } - - std::string LATServer::print_interfaces() - { - struct ifreq ifr; - std::string str; - int sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); - - for (int i=0; i<num_interfaces;i++) - { - ifr.ifr_ifindex = interface_num[i]; - - if (ioctl(sock, SIOCGIFNAME, &ifr) == 0) - { - str.append(ifr.ifr_name); - str.append(" "); - } - else - { - char num[10]; - snprintf(num, sizeof(num), "%d ", interface_num[i]); - str.append(num); - } - } - - close(sock); - return str; - } - - - /* Find the interface named <ifname> and return it's number - Also save the MAC address in <macaddr>. - Return -1 if we didn't find it or it's not ethernet, - */ - int LATServer::find_interface(char *ifname) - { - struct ifreq ifr; - int iindex = 1; - int sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); - - ifr.ifr_ifindex = iindex; - - while (ioctl(sock, SIOCGIFNAME, &ifr) == 0) - { - if (strcmp(ifr.ifr_name, ifname) == 0) - { - // Also check it's ethernet while we are here - ioctl(sock, SIOCGIFHWADDR, &ifr); - if (ifr.ifr_hwaddr.sa_family != ARPHRD_ETHER) - { - syslog(LOG_ERR, "Device %s is not ethernet\n", ifname); - return -1; - } - close(sock); - return iindex; - } - ifr.ifr_ifindex = ++iindex; - } - // Didn't find it - close(sock); - return -1; - } - // Remove any dangling symlinks in the /dev/lat directory void LATServer::tidy_dev_directory() --- 57,65 ---- #include "server.h" #include "services.h" + //#include "interfaces.h" + #include "interfaces-linux.h" #include "lat_messages.h" #include "dn_endian.h" // Remove any dangling symlinks in the /dev/lat directory void LATServer::tidy_dev_directory() *************** *** 216,220 **** unsigned char packet[1600]; int ptr; - struct sockaddr_ll sock_info; struct utsname uinfo; char *myname; --- 117,120 ---- *************** *** 318,323 **** } - - // Not sure what node service classes are // probably somthing to do with port services and stuff. --- 218,221 ---- *************** *** 325,348 **** packet[ptr++] = 0x01; // Node service classes ! /* Build the sockaddr_ll structure */ ! sock_info.sll_family = AF_PACKET; ! sock_info.sll_protocol = htons(ETH_P_LAT); ! sock_info.sll_hatype = 0;//ARPHRD_ETHER; ! sock_info.sll_pkttype = PACKET_MULTICAST; ! sock_info.sll_halen = 6; ! /* This is the LAT multicast address */ ! sock_info.sll_addr[0] = 0x09; ! sock_info.sll_addr[1] = 0x00; ! sock_info.sll_addr[2] = 0x2b; ! sock_info.sll_addr[3] = 0x00; ! sock_info.sll_addr[4] = 0x00; ! sock_info.sll_addr[5] = 0x0f; for (int i=0; i<num_interfaces;i++) { ! sock_info.sll_ifindex = interface_num[i]; ! if (sendto(lat_socket, packet, ptr, 0, ! (struct sockaddr *)&sock_info, sizeof(sock_info)) < 0) { interface_error(interface_num[i], errno); --- 223,238 ---- packet[ptr++] = 0x01; // Node service classes ! unsigned char addr[6]; /* This is the LAT multicast address */ ! addr[0] = 0x09; ! addr[1] = 0x00; ! addr[2] = 0x2b; ! addr[3] = 0x00; ! addr[4] = 0x00; ! addr[5] = 0x0f; for (int i=0; i<num_interfaces;i++) { ! if (iface->send_packet(interface_num[i], addr, packet, ptr) < 0) { interface_error(interface_num[i], errno); *************** *** 362,376 **** void LATServer::interface_error(int ifnum, int err) { ! struct ifreq ifr; ! int sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); ! ! ifr.ifr_ifindex = ifnum; ! ! if (ioctl(sock, SIOCGIFNAME, &ifr) == 0) ! syslog(LOG_ERR, "Error on interface %s: %s\n", ifr.ifr_name, strerror(err)); ! else ! syslog(LOG_ERR, "Error on interface %d: %s\n", ifnum, strerror(err)); ! ! close(sock); // Too many errors, remove it --- 252,256 ---- void LATServer::interface_error(int ifnum, int err) { ! syslog(LOG_ERR, "Error on interface %s: %s\n", iface->ifname(ifnum).c_str(), strerror(err)); // Too many errors, remove it *************** *** 417,475 **** int status; ! // Open LAT protocol socket ! lat_socket = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_LAT)); ! if (lat_socket < 0) { ! syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); ! exit(1); } ! struct sockaddr_ll sock_info; ! /* Build the sockaddr_ll structure */ ! sock_info.sll_family = AF_PACKET; ! sock_info.sll_protocol = htons(ETH_P_LAT); ! ! // If there's only one interface then bind to it. ! if (num_interfaces == 1) { ! sock_info.sll_ifindex = interface_num[0]; ! if (bind(lat_socket, (struct sockaddr *)&sock_info, sizeof(sock_info))) { ! syslog(LOG_ERR, "can't bind lat socket: %m\n"); ! exit(1); } } ! ! ! // Add Multicast membership for LAT on socket ! struct packet_mreq pack_info; ! ! /* Fill in socket options */ ! pack_info.mr_type = PACKET_MR_MULTICAST; ! pack_info.mr_alen = 6; ! ! /* This is the LAT multicast address */ ! pack_info.mr_address[0] = 0x09; ! pack_info.mr_address[1] = 0x00; ! pack_info.mr_address[2] = 0x2b; ! pack_info.mr_address[3] = 0x00; ! pack_info.mr_address[4] = 0x00; ! pack_info.mr_address[5] = 0x0f; ! ! for (int i=0; i<num_interfaces;i++) { ! pack_info.mr_ifindex = interface_num[i]; ! ! if (setsockopt(lat_socket, SOL_PACKET, PACKET_ADD_MEMBERSHIP, ! &pack_info, sizeof(pack_info))) ! { ! syslog(LOG_ERR, "can't add lat socket multicast : %m\n"); ! exit(1); ! } } - // Add it to the sockets list - fdlist.push_back(fdinfo(lat_socket, 0, LAT_SOCKET)); - // Open LATCP socket unlink(LATCP_SOCKNAME); --- 297,319 ---- int status; ! // Bind interfaces ! for (int i=0; i<num_interfaces;i++) { ! iface->open_connection(interface_num[i]); } ! // Add it/them to the sockets list ! if (iface->one_fd_per_interface()) { ! for (int i=0; i<num_interfaces;i++) { ! fdlist.push_back(fdinfo(iface->get_fd(interface_num[i]), 0, LAT_SOCKET)); } } ! else { ! fdlist.push_back(fdinfo(iface->get_fd(0), 0, LAT_SOCKET)); } // Open LATCP socket unlink(LATCP_SOCKNAME); *************** *** 614,634 **** void LATServer::read_lat(int sock) { ! unsigned char buf[1600]; int len; int i; ! struct msghdr msg; ! struct iovec iov; ! struct sockaddr_ll sock_info; LAT_Header *header = (LAT_Header *)buf; ! msg.msg_name = &sock_info; ! msg.msg_namelen = sizeof(sock_info); ! msg.msg_iovlen = 1; ! msg.msg_iov = &iov; ! iov.iov_len = sizeof(buf); ! iov.iov_base = buf; ! ! len = recvmsg(sock, &msg, 0); ! if (len < 0) { if (errno != EINTR) --- 458,470 ---- void LATServer::read_lat(int sock) { ! unsigned char buf[1600]; ! unsigned char macaddr[6]; int len; int i; ! int ifn; LAT_Header *header = (LAT_Header *)buf; ! len = iface->recv_packet(sock, ifn, macaddr, buf, sizeof(buf)); ! if (len <= 0) { if (errno != EINTR) *************** *** 643,653 **** if (locked) return; - // Ignore packets captured in promiscuous mode. - if (sock_info.sll_pkttype == PACKET_OTHERHOST) - { - debuglog(("Got a rogue packet .. interface probably in promiscuous mode\n")); - return; - } - // Parse & dispatch it. switch(header->cmd) --- 479,482 ---- *************** *** 661,671 **** if (conn) { ! conn->process_session_cmd(buf, len, (unsigned char *)&sock_info.sll_addr); } else { // Message format error ! send_connect_error(2, header, sock_info.sll_ifindex, ! (unsigned char *)&sock_info.sll_addr); } } --- 490,499 ---- if (conn) { ! conn->process_session_cmd(buf, len, macaddr); } else { // Message format error ! send_connect_error(2, header, ifn, macaddr); } } *************** *** 686,696 **** { // How the &?* did that happen? ! send_connect_error(2, header, sock_info.sll_ifindex, (unsigned char *)&sock_info.sll_addr); return; } // Make a new connection. ! if ( ((i=make_new_connection(buf, len, sock_info.sll_ifindex, ! header, (unsigned char *)&sock_info.sll_addr) )) > 0) { debuglog(("Made new connection: %d\n", i)); --- 514,523 ---- { // How the &?* did that happen? ! send_connect_error(2, header, ifn, macaddr); return; } // Make a new connection. ! if ( ((i=make_new_connection(buf, len, ifn, header, macaddr) )) > 0) { debuglog(("Made new connection: %d\n", i)); *************** *** 711,715 **** { // Insufficient resources ! send_connect_error(7, header, sock_info.sll_ifindex, (unsigned char *)&sock_info.sll_addr); } } --- 538,542 ---- { // Insufficient resources ! send_connect_error(7, header, ifn, macaddr); } } *************** *** 748,752 **** { // Message format error ! send_connect_error(2, header, sock_info.sll_ifindex, (unsigned char *)&sock_info.sll_addr); } } --- 575,579 ---- { // Message format error ! send_connect_error(2, header, ifn, macaddr); } } *************** *** 755,763 **** case LAT_CCMD_SERVICE: // Keep a list of known services ! add_services(buf, len, sock_info.sll_ifindex, (unsigned char *)&sock_info.sll_addr); break; case LAT_CCMD_ENQUIRE: ! reply_to_enq(buf, len, sock_info.sll_ifindex, (unsigned char *)&sock_info.sll_addr); break; --- 582,590 ---- case LAT_CCMD_SERVICE: // Keep a list of known services ! add_services(buf, len, ifn, macaddr); break; case LAT_CCMD_ENQUIRE: ! reply_to_enq(buf, len, ifn, macaddr); break; *************** *** 811,836 **** int LATServer::send_message(unsigned char *buf, int len, int interface, unsigned char *macaddr) { - struct sockaddr_ll sock_info; - if (len < 46) len = 46; // Minimum packet length if (len%2) len++; // Must be an even number - /* Build the sockaddr_ll structure */ - sock_info.sll_family = AF_PACKET; - sock_info.sll_protocol = htons(ETH_P_LAT); - sock_info.sll_ifindex = interface; - sock_info.sll_hatype = 0;//ARPHRD_ETHER; - sock_info.sll_pkttype = PACKET_MULTICAST; - sock_info.sll_halen = 6; - memcpy(sock_info.sll_addr, macaddr, 6); - - if (interface == 0) // Send to all { for (int i=0; i<num_interfaces;i++) { ! sock_info.sll_ifindex = interface_num[i]; ! if (sendto(lat_socket, buf, len, 0, ! (struct sockaddr *)&sock_info, sizeof(sock_info)) < 0) { interface_error(interface_num[i], errno); --- 638,649 ---- int LATServer::send_message(unsigned char *buf, int len, int interface, unsigned char *macaddr) { if (len < 46) len = 46; // Minimum packet length if (len%2) len++; // Must be an even number if (interface == 0) // Send to all { for (int i=0; i<num_interfaces;i++) { ! if (iface->send_packet(interface_num[i], macaddr, buf, len) < 0) { interface_error(interface_num[i], errno); *************** *** 843,848 **** else { ! if (sendto(lat_socket, buf, len, 0, ! (struct sockaddr *)&sock_info, sizeof(sock_info)) < 0) { interface_error(interface, errno); --- 656,660 ---- else { ! if (iface->send_packet(interface, macaddr, buf, len) < 0) { interface_error(interface, errno); *************** *** 989,992 **** --- 801,813 ---- locked = true; + /* Initialise the platform-specific interface code */ + iface = new LinuxInterfaces(); + if (iface->Start() == -1) + { + syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); + exit(1); + + } + // Add the default session servicelist.push_back(serviceinfo(_service, *************** *** 1003,1007 **** while (_interfaces[i]) { ! interface_num[num_interfaces] = find_interface(_interfaces[i]); if (interface_num[num_interfaces] == -1) { --- 824,828 ---- while (_interfaces[i]) { ! interface_num[num_interfaces] = iface->find_interface(_interfaces[i]); if (interface_num[num_interfaces] == -1) { *************** *** 1023,1027 **** else { ! get_all_interfaces(); } --- 844,848 ---- else { ! iface->get_all_interfaces(interface_num, num_interfaces); } *************** *** 1571,1575 **** const char *service, const char *rnode, const char *port, ! const char *localport, bool queued) { int ret; --- 1392,1398 ---- const char *service, const char *rnode, const char *port, ! const char *localport, ! const char *password, ! bool queued) { int ret; *************** *** 1629,1633 **** // TODO: Different call into Connection() ! ret = connections[connid]->create_localport_session(fd, lport, service, port, localport); return ret; --- 1452,1457 ---- // TODO: Different call into Connection() ! ret = connections[connid]->create_localport_session(fd, lport, service, ! port, localport, password); return ret; *************** *** 1643,1650 **** unsigned char *remnode, bool queued, ! bool clean) { debuglog(("Server::create_local_port: %s\n", devname)); ! portlist.push_back(LocalPort(service, portname, devname, remnode, queued, clean)); // Find the actual port in the list and start it up, this is because --- 1467,1475 ---- unsigned char *remnode, bool queued, ! bool clean, ! unsigned char *password) { debuglog(("Server::create_local_port: %s\n", devname)); ! portlist.push_back(LocalPort(service, portname, devname, remnode, queued, clean, password)); // Find the actual port in the list and start it up, this is because *************** *** 1674,1679 **** output << "Service Responder : " << (responder?"Enabled":"Disabled") << std::endl; ! output << "Interfaces : " << print_interfaces() << std::endl; ! output << std::endl; output << "Circuit Timer (msec): " << std::setw(6) << circuit_timer*10 << " Keepalive Timer (sec): " << std::setw(6) << keepalive_timer << std::endl; --- 1499,1508 ---- output << "Service Responder : " << (responder?"Enabled":"Disabled") << std::endl; ! output << "Interfaces : "; ! for (int i=0; i<num_interfaces; i++) ! { ! output << iface->ifname(interface_num[i]) << " "; ! } ! output << std::endl << std::endl; output << "Circuit Timer (msec): " << std::setw(6) << circuit_timer*10 << " Keepalive Timer (sec): " << std::setw(6) << keepalive_timer << std::endl; |
From: Patrick C. <pa...@us...> - 2002-02-08 15:06:56
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv2336 Modified Files: server.h Makefile Added Files: interfaces-linux.cc interfaces-linux.h interfaces.cc interfaces.h Log Message: Move all the Linux-specific code into it's own class which subclasses an abstract base class. This should make porting very easy (for those that know how to to LAT sockets on other platforms that is!) --- NEW FILE: interfaces-linux.cc --- /****************************************************************************** (c) 2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ******************************************************************************/ #include <sys/types.h> #include <sys/uio.h> #include <sys/socket.h> #include <sys/un.h> #include <sys/ioctl.h> #include <sys/wait.h> #include <sys/stat.h> #include <sys/time.h> #include <sys/utsname.h> #include <stdio.h> #include <errno.h> #include <unistd.h> #include <signal.h> #include <string.h> #include <fcntl.h> #include <dirent.h> #include <syslog.h> #include <ctype.h> #include <regex.h> #include <stdlib.h> #include <utmp.h> #include <grp.h> #include <signal.h> #include <assert.h> #include <netinet/in.h> #include <features.h> /* for the glibc version number */ #if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || __GLIBC__ >= 3 #include <netpacket/packet.h> #include <net/ethernet.h> /* the L2 protocols */ #include <net/if_arp.h> #include <linux/if.h> #else #include <asm/types.h> #include <linux/if.h> #include <linux/if_arp.h> #include <linux/if_packet.h> #include <linux/if_ether.h> /* The L2 protocols */ #endif #include <list> #include <queue> #include <map> #include <string> #include <algo.h> #include <iterator> #include <strstream> #include <iomanip> #include "utils.h" #include "interfaces.h" #include "interfaces-linux.h" int LinuxInterfaces::Start() { // Open LAT protocol socket fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_LAT)); if (fd < 0) { syslog(LOG_ERR, "Can't create LAT protocol socket: %m\n"); return -1; } return 0; } // Return a list of valid interface numbers and the count void LinuxInterfaces::get_all_interfaces(int *ifs, int &num) { struct ifreq ifr; int iindex = 1; int sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); num = 0; ifr.ifr_ifindex = iindex; while (ioctl(sock, SIOCGIFNAME, &ifr) == 0) { // Only use ethernet interfaces ioctl(sock, SIOCGIFHWADDR, &ifr); if (ifr.ifr_hwaddr.sa_family == ARPHRD_ETHER) { debuglog(("interface %d: %d\n", num, iindex)); ifs[num++] = iindex; } ifr.ifr_ifindex = ++iindex; } close(sock); } // Print the name of an interface std::string LinuxInterfaces::ifname(int ifn) { struct ifreq ifr; int sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); ifr.ifr_ifindex = ifn; if (ioctl(sock, SIOCGIFNAME, &ifr) == 0) { close(sock); return std::string((char *)ifr.ifr_name); } // Didn't find it close(sock); return std::string(""); } // Find an interface number by name int LinuxInterfaces::find_interface(char *name) { struct ifreq ifr; int iindex = 1; int sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); ifr.ifr_ifindex = iindex; while (ioctl(sock, SIOCGIFNAME, &ifr) == 0) { if (strcmp(ifr.ifr_name, name) == 0) { // Also check it's ethernet while we are here ioctl(sock, SIOCGIFHWADDR, &ifr); if (ifr.ifr_hwaddr.sa_family != ARPHRD_ETHER) { syslog(LOG_ERR, "Device %s is not ethernet\n", name); return -1; } close(sock); return iindex; } ifr.ifr_ifindex = ++iindex; } // Didn't find it close(sock); return -1; } // true if this class defines one FD for each active // interface, false if one fd is used for all interfaces. bool LinuxInterfaces::one_fd_per_interface() { return false; } // Return the FD for this interface (will only be called once for // select if above returns false) int LinuxInterfaces::get_fd(int ifn) { return fd; } // Send a packet to a given macaddr int LinuxInterfaces::send_packet(int ifn, unsigned char macaddr[], unsigned char *data, int len) { struct sockaddr_ll sock_info; /* Build the sockaddr_ll structure */ sock_info.sll_family = AF_PACKET; sock_info.sll_protocol = htons(ETH_P_LAT); sock_info.sll_ifindex = ifn; sock_info.sll_hatype = 0;//ARPHRD_ETHER; sock_info.sll_pkttype = PACKET_MULTICAST; sock_info.sll_halen = 6; memcpy(sock_info.sll_addr, macaddr, 6); return sendto(fd, data, len, 0, (struct sockaddr *)&sock_info, sizeof(sock_info)); } // Receive a packet from a given interface int LinuxInterfaces::recv_packet(int sockfd, int &ifn, unsigned char macaddr[], unsigned char *data, int maxlen) { struct msghdr msg; struct iovec iov; struct sockaddr_ll sock_info; int len; msg.msg_name = &sock_info; msg.msg_namelen = sizeof(sock_info); msg.msg_iovlen = 1; msg.msg_iov = &iov; iov.iov_len = maxlen; iov.iov_base = data; len = recvmsg(sockfd, &msg, 0); ifn = sock_info.sll_ifindex; memcpy(macaddr, sock_info.sll_addr, 6); // Ignore packets captured in promiscuous mode. if (sock_info.sll_pkttype == PACKET_OTHERHOST) { debuglog(("Got a rogue packet .. interface probably in promiscuous mode\n")); return 0; } return len; } // Open a connection on an interface int LinuxInterfaces::open_connection(int ifn) { // Add Multicast membership for LAT on socket struct packet_mreq pack_info; /* Fill in socket options */ pack_info.mr_type = PACKET_MR_MULTICAST; pack_info.mr_alen = 6; pack_info.mr_ifindex = ifn; /* This is the LAT multicast address */ pack_info.mr_address[0] = 0x09; pack_info.mr_address[1] = 0x00; pack_info.mr_address[2] = 0x2b; pack_info.mr_address[3] = 0x00; pack_info.mr_address[4] = 0x00; pack_info.mr_address[5] = 0x0f; 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; } // Close an interface. int LinuxInterfaces::close_connection(int ifn) { // Add Multicast membership for LAT on socket struct packet_mreq pack_info; /* Fill in socket options */ pack_info.mr_type = PACKET_MR_MULTICAST; pack_info.mr_alen = 6; pack_info.mr_ifindex = ifn; /* This is the LAT multicast address */ pack_info.mr_address[0] = 0x09; pack_info.mr_address[1] = 0x00; pack_info.mr_address[2] = 0x2b; pack_info.mr_address[3] = 0x00; pack_info.mr_address[4] = 0x00; pack_info.mr_address[5] = 0x0f; if (setsockopt(fd, SOL_PACKET, PACKET_DROP_MEMBERSHIP, &pack_info, sizeof(pack_info))) { syslog(LOG_ERR, "can't add remove socket multicast : %m\n"); return -1; } return 0; } --- NEW FILE: interfaces-linux.h --- /****************************************************************************** (c) 2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ******************************************************************************/ // interfaces-linux.h // Linux implementation of LATinterfaces class LinuxInterfaces : public LATinterfaces { public: LinuxInterfaces() {}; ~LinuxInterfaces() {}; // Initialise virtual int Start(); // Return a list of valid interface numbers and the count virtual void get_all_interfaces(int *ifs, int &num); // Print the name of an interface virtual std::string ifname(int ifn); // Find an interface number by name virtual int find_interface(char *name); // true if this class defines one FD for each active // interface, false if one fd is used for all interfaces. virtual bool one_fd_per_interface(); // Return the FD for this interface (will only be called once for // select if above returns false) virtual int get_fd(int ifn); // Send a packet to a given macaddr virtual int send_packet(int ifn, unsigned char macaddr[], unsigned char *data, int len); // Receive a packet from a given interface virtual int recv_packet(int sockfd, int &ifn, unsigned char macaddr[], unsigned char *data, int maxlen); // Open a connection on an interface virtual int open_connection(int ifn); // Close an interface. virtual int close_connection(int ifn); private: int fd; }; --- NEW FILE: interfaces.cc --- /****************************************************************************** (c) 2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ******************************************************************************/ #include <string> #include "interfaces.h" LATinterfaces::LATinterfaces() { } LATinterfaces::~LATinterfaces() { } --- NEW FILE: interfaces.h --- /****************************************************************************** (c) 2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ******************************************************************************/ // interfaces.h // Abstract out the linux-specific ioctls and interface stuff. // // To port latd, all you should need to do is extend this class with // your platform-specific functions. // See linux-interface.cc for example implementation. class LATinterfaces { public: LATinterfaces(); virtual ~LATinterfaces(); // Initialise the LAT protocol virtual int Start()=0; // Return a list of valid interface numbers and the count virtual void get_all_interfaces(int ifs[], int &num)=0; // Print the name of an interface virtual std::string ifname(int ifn) = 0; // Find an interface number by name virtual int find_interface(char *name)=0; // true if this class defines one FD for each active // interface, false if one fd is used for all interfaces. virtual bool one_fd_per_interface()=0; // Return the FD for this interface (will only be called once for // select if above returns false virtual int get_fd(int ifn)=0; // Send a packet to a given macaddr virtual int send_packet(int ifn, unsigned char macaddr[], unsigned char *data, int len)=0; // Receive a packet from a given FD (note FD not iface) virtual int recv_packet(int fd, int &ifn, unsigned char macaddr[], unsigned char *data, int maxlen)=0; // Open a connection on an interface virtual int open_connection(int ifn)=0; // Close an interface. virtual int close_connection(int ifn)=0; }; Index: server.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -r1.31 -r1.32 *** server.h 3 Jan 2002 09:45:17 -0000 1.31 --- server.h 8 Feb 2002 15:06:52 -0000 1.32 *************** *** 1,4 **** /****************************************************************************** ! (c) 2000 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2000-2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 14,18 **** // Singleton server object #define MAX_INTERFACES 255 ! class LATServer { --- 14,18 ---- // Singleton server object #define MAX_INTERFACES 255 ! #include "interfaces.h" class LATServer { *************** *** 84,90 **** gid_t lat_group; - void get_all_interfaces(); - std::string print_interfaces(); - int find_interface(char *ifname); void read_lat(int sock); float get_loadavg(); --- 84,87 ---- *************** *** 256,259 **** --- 253,257 ---- bool groups_set; // Have the server groups been set ? unsigned char user_groups[32]; // Bitmap of user groups..always in use + LATinterfaces *iface; // LATCP Circuit callins *************** *** 272,279 **** bool show_characteristics(bool verbose, std::ostrstream &output); int create_local_port(unsigned char *, unsigned char *, ! unsigned char *, unsigned char *, bool, bool); int make_llogin_connection(int fd, char *, char *, char *, char *, char *, bool); int make_port_connection(int fd, LocalPort *, const char *, const char *, const char *, ! const char *, bool); int set_servergroups(unsigned char *bitmap); int unset_servergroups(unsigned char *bitmap); --- 270,278 ---- bool show_characteristics(bool verbose, std::ostrstream &output); int create_local_port(unsigned char *, unsigned char *, ! unsigned char *, unsigned char *, bool, bool, ! unsigned char *); int make_llogin_connection(int fd, char *, char *, char *, char *, char *, bool); int make_port_connection(int fd, LocalPort *, const char *, const char *, const char *, ! const char *, const char *, bool); int set_servergroups(unsigned char *bitmap); int unset_servergroups(unsigned char *bitmap); Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/latd/Makefile,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** Makefile 7 Jan 2002 15:56:35 -0000 1.27 --- Makefile 8 Feb 2002 15:06:52 -0000 1.28 *************** *** 15,19 **** serversession.o clientsession.o queuedsession.o services.o \ latcpcircuit.o lat_messages.o lloginsession.o llogincircuit.o \ ! circuit.o localport.o localportsession.o PROG2OBJS=latcp.o utils.o PROG3OBJS=llogin.o utils.o --- 15,19 ---- serversession.o clientsession.o queuedsession.o services.o \ latcpcircuit.o lat_messages.o lloginsession.o llogincircuit.o \ ! circuit.o localport.o localportsession.o interfaces.o interfaces-linux.o PROG2OBJS=latcp.o utils.o PROG3OBJS=llogin.o utils.o |
From: Patrick C. <pa...@us...> - 2002-01-18 19:15:48
|
Update of /cvsroot/linux-decnet/dnprogs/scripts In directory usw-pr-cvs1:/tmp/cvs-serv8599/scripts Modified Files: Makefile Log Message: More makefile fixed from my Makefile guru Maciej W. Rozycki Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/scripts/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** Makefile 2001/01/27 15:11:48 1.4 --- Makefile 2002/01/18 19:15:45 1.5 *************** *** 14,23 **** ifndef MAKEDEB if [ -d /var/lib/dpkg ]; then \ ! install -Dm 0700 decnet.sh $(DESTDIR)/etc/init.d/decnet.sh; \ elif [ -d /var/lib/YaST ]; then \ ! install -Dm 0700 decnet.sh $(DESTDIR)/sbin/init.d/decnet; \ elif [ -d /var/lib/rpm ]; then \ ! install -Dm 0700 decnet.sh $(DESTDIR)/etc/rc.d/init.d/decnet; \ ! else install -Dm 0700 rc.decnet $(DESTDIR)/etc/rc.d/rc.decnet; \ fi endif --- 14,23 ---- ifndef MAKEDEB if [ -d /var/lib/dpkg ]; then \ ! install -Dm 0700 decnet.sh $(sysconfprefix)/etc/init.d/decnet.sh; \ elif [ -d /var/lib/YaST ]; then \ ! install -Dm 0700 decnet.sh $(sysconfprefix)/sbin/init.d/decnet; \ elif [ -d /var/lib/rpm ]; then \ ! install -Dm 0700 decnet.sh $(sysconfprefix)/etc/rc.d/init.d/decnet; \ ! else install -Dm 0700 rc.decnet $(sysconfprefix)/etc/rc.d/rc.decnet; \ fi endif |
From: Patrick C. <pa...@us...> - 2002-01-18 19:15:48
|
Update of /cvsroot/linux-decnet/dnprogs/mail In directory usw-pr-cvs1:/tmp/cvs-serv8599/mail Modified Files: Makefile Log Message: More makefile fixed from my Makefile guru Maciej W. Rozycki Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/mail/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** Makefile 2001/07/17 08:01:14 1.5 --- Makefile 2002/01/18 19:15:45 1.6 *************** *** 6,10 **** PROG2=sendvmsmail ! UULIB=uulib/libuu.a MANPAGES5=vmsmail.conf.5 --- 6,12 ---- PROG2=sendvmsmail ! UUDIR=uulib ! UULIB=$(UUDIR)/libuu.a ! LIBUU=$(UULIB) MANPAGES5=vmsmail.conf.5 *************** *** 14,23 **** PROG2OBJS=sendvmsmail.o configfile.o ! CDEFS+=-Iuulib -DPROTOTYPES all: $(UULIB) $(PROG1) $(PROG2) $(UULIB): ! make -C uulib .c.o: --- 16,25 ---- PROG2OBJS=sendvmsmail.o configfile.o ! CDEFS+=-I$(UUDIR) -DPROTOTYPES all: $(UULIB) $(PROG1) $(PROG2) $(UULIB): ! make -C $(UUDIR) .c.o: *************** *** 25,32 **** $(PROG1): $(PROG1OBJS) $(DEPLIBDNET) $(DEPLIBDAEMON) $(UULIB) ! $(CC) $(CFLAGS) -o $@ $(PROG1OBJS) $(LIBDNET) $(UULIB) $(LIBDAEMON) $(PROG2): $(PROG2OBJS) $(DEPLIBDNET) $(UULIB) ! $(CC) $(CFLAGS) -o $@ $(PROG2OBJS) $(LIBDNET) $(UULIB) install: --- 27,34 ---- $(PROG1): $(PROG1OBJS) $(DEPLIBDNET) $(DEPLIBDAEMON) $(UULIB) ! $(CC) $(CFLAGS) -o $@ $(PROG1OBJS) $(LIBDNET) $(LIBUU) $(LIBDAEMON) $(PROG2): $(PROG2OBJS) $(DEPLIBDNET) $(UULIB) ! $(CC) $(CFLAGS) -o $@ $(PROG2OBJS) $(LIBDNET) $(LIBUU) install: *************** *** 44,48 **** clean: rm -f $(PROG1) $(PROG2) *.o *.bak .depend ! make -Cuulib clean --- 46,50 ---- clean: rm -f $(PROG1) $(PROG2) *.o *.bak .depend ! make -C $(UUDIR) clean |
From: Patrick C. <pa...@us...> - 2002-01-18 19:15:48
|
Update of /cvsroot/linux-decnet/dnprogs/librms In directory usw-pr-cvs1:/tmp/cvs-serv8599/librms Modified Files: Makefile Log Message: More makefile fixed from my Makefile guru Maciej W. Rozycki Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/librms/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** Makefile 2001/07/17 08:01:14 1.4 --- Makefile 2002/01/18 19:15:45 1.5 *************** *** 17,20 **** --- 17,21 ---- CFLAGS+=-I. -I../include -I../libdap -fdollars-in-identifiers + LDFLAGS+=-Wl,-rpath-link,../libdnet -Wl,-rpath-link,../libdap all: $(STATICLIB) $(SHAREDLIB) $(EXAMPLES) *************** *** 24,36 **** $(SHAREDLIB): $(PICOBJS) ! $(CXX) $(CXXFLAGS) -shared -o $@ -Wl,-soname=$(LIBNAME).so.$(MAJOR_VERSION) $^ ln -sf $(SHAREDLIB) $(LIBNAME).so.$(MAJOR_VERSION) ln -sf $(LIBNAME).so.$(MAJOR_VERSION) $(LIBNAME).so $(EXAMPLE1): $(EXAMPLE1OBJS) $(SHAREDLIB) ! $(CC) $(CXXFLAGS) -o $@ $< -L. -lrms $(LIBS) $(EXAMPLE2): $(EXAMPLE2OBJS) $(SHAREDLIB) ! $(CC) $(CXXFLAGS) -o $@ $< -L. -lrms $(LIBS) .cc.o: --- 25,37 ---- $(SHAREDLIB): $(PICOBJS) ! $(CXX) $(CXXFLAGS) -shared -o $@ -Wl,-soname=$(LIBNAME).so.$(MAJOR_VERSION) $^ $(LIBS) ln -sf $(SHAREDLIB) $(LIBNAME).so.$(MAJOR_VERSION) ln -sf $(LIBNAME).so.$(MAJOR_VERSION) $(LIBNAME).so $(EXAMPLE1): $(EXAMPLE1OBJS) $(SHAREDLIB) ! $(CC) $(CXXFLAGS) $(LDFLAGS) -o $@ $< -L. -lrms $(EXAMPLE2): $(EXAMPLE2OBJS) $(SHAREDLIB) ! $(CC) $(CXXFLAGS) $(LDFLAGS) -o $@ $< -L. -lrms .cc.o: |
From: Patrick C. <pa...@us...> - 2002-01-18 19:15:48
|
Update of /cvsroot/linux-decnet/dnprogs/libdaemon In directory usw-pr-cvs1:/tmp/cvs-serv8599/libdaemon Modified Files: Makefile Log Message: More makefile fixed from my Makefile guru Maciej W. Rozycki Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/libdaemon/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** Makefile 2001/07/17 14:51:51 1.6 --- Makefile 2002/01/18 19:15:45 1.7 *************** *** 17,21 **** $(SHAREDLIB): $(PICOBJS) ! $(CC) $(CCFLAGS) -shared -o $@ -Wl,-soname=$(LIBNAME).so.$(MAJOR_VERSION) $^ ln -sf $(SHAREDLIB) $(LIBNAME).so.$(MAJOR_VERSION) ln -sf $(LIBNAME).so.$(MAJOR_VERSION) $(LIBNAME).so --- 17,21 ---- $(SHAREDLIB): $(PICOBJS) ! $(CC) $(CCFLAGS) -shared -o $@ -Wl,-soname=$(LIBNAME).so.$(MAJOR_VERSION) $(LIBCRYPT) $^ ln -sf $(SHAREDLIB) $(LIBNAME).so.$(MAJOR_VERSION) ln -sf $(LIBNAME).so.$(MAJOR_VERSION) $(LIBNAME).so |
From: Patrick C. <pa...@us...> - 2002-01-18 19:15:48
|
Update of /cvsroot/linux-decnet/dnprogs/libdnet In directory usw-pr-cvs1:/tmp/cvs-serv8599/libdnet Modified Files: Makefile Log Message: More makefile fixed from my Makefile guru Maciej W. Rozycki Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/libdnet/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** Makefile 2001/07/17 08:59:18 1.5 --- Makefile 2002/01/18 19:15:45 1.6 *************** *** 3,8 **** #-------------------------------------------------------------------------- include ../Makefile.common ! LD=gcc ! LDFLAGS=-O -shared AR=ar ARFLAGS=rcs --- 3,8 ---- #-------------------------------------------------------------------------- include ../Makefile.common ! CC=gcc ! LDFLAGS=-O AR=ar ARFLAGS=rcs *************** *** 30,34 **** $(SHAREDLIB): ${PICOBJS} ! ${LD} ${LDFLAGS} -o $@ ${PICOBJS} -Wl,-soname=libdnet.so.$(MAJOR_VERSION) -lc ln -sf $(SHAREDLIB) $(LIBNAME).so.$(MAJOR_VERSION) ln -sf $(LIBNAME).so.$(MAJOR_VERSION) $(LIBNAME).so --- 30,34 ---- $(SHAREDLIB): ${PICOBJS} ! ${CC} ${LDFLAGS} -shared -o $@ ${PICOBJS} -Wl,-soname=libdnet.so.$(MAJOR_VERSION) ln -sf $(SHAREDLIB) $(LIBNAME).so.$(MAJOR_VERSION) ln -sf $(LIBNAME).so.$(MAJOR_VERSION) $(LIBNAME).so |
From: Patrick C. <pa...@us...> - 2002-01-18 19:15:47
|
Update of /cvsroot/linux-decnet/dnprogs In directory usw-pr-cvs1:/tmp/cvs-serv8599 Modified Files: Makefile Makefile.common Log Message: More makefile fixed from my Makefile guru Maciej W. Rozycki Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/Makefile,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** Makefile 2001/09/13 13:49:31 1.15 --- Makefile 2002/01/18 19:15:44 1.16 *************** *** 12,16 **** all: ! # @. scripts/check_kernel.sh; if [ $$? = 1 ]; then exit 1; fi @set -e; for i in $(SUBDIRS); do make -C $$i $@ ; done --- 12,16 ---- all: ! @. scripts/check_kernel.sh; if [ $$? = 1 ]; then exit 1; fi @set -e; for i in $(SUBDIRS); do make -C $$i $@ ; done Index: Makefile.common =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/Makefile.common,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** Makefile.common 2001/12/08 13:18:31 1.14 --- Makefile.common 2002/01/18 19:15:45 1.15 *************** *** 121,125 **** LIBDNET=-L../libdnet -ldnet LIBDAP=-L../libdap -ldap ! LIBDAEMON=-L../libdaemon -ldnet_daemon $(LIBCRYPT) DEPLIBDNET=../libdnet/libdnet.so DEPLIBDAEMON=../libdaemon/libdnet_daemon.so --- 121,125 ---- LIBDNET=-L../libdnet -ldnet LIBDAP=-L../libdap -ldap ! LIBDAEMON=-L../libdaemon -ldnet_daemon DEPLIBDNET=../libdnet/libdnet.so DEPLIBDAEMON=../libdaemon/libdnet_daemon.so |
From: Patrick C. <pa...@us...> - 2002-01-18 19:15:47
|
Update of /cvsroot/linux-decnet/dnprogs/include In directory usw-pr-cvs1:/tmp/cvs-serv8599/include Modified Files: Makefile Log Message: More makefile fixed from my Makefile guru Maciej W. Rozycki Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/include/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Makefile 2001/02/09 11:58:04 1.2 --- Makefile 2002/01/18 19:15:45 1.3 *************** *** 11,15 **** install: ! if [ -L $(libprefix)/include/netdnet ]; then rm -f $(libprefix)/include/netdnet; fi install -d $(libprefix)/include/netdnet install -m 0644 netdnet/dn.h $(libprefix)/include/netdnet --- 11,17 ---- install: ! if [ -L $(libprefix)/include/netdnet ]; then \ ! rm -f $(libprefix)/include/netdnet; \ ! fi install -d $(libprefix)/include/netdnet install -m 0644 netdnet/dn.h $(libprefix)/include/netdnet |
From: Patrick C. <pa...@us...> - 2002-01-18 19:15:47
|
Update of /cvsroot/linux-decnet/dnprogs/dnsubmit In directory usw-pr-cvs1:/tmp/cvs-serv8599/dnsubmit Modified Files: Makefile Log Message: More makefile fixed from my Makefile guru Maciej W. Rozycki Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnsubmit/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Makefile 2001/07/17 08:01:14 1.2 --- Makefile 2002/01/18 19:15:45 1.3 *************** *** 12,16 **** all: $(PROG1) $(PROG2) ! $(PROG1): $(PROG1OBJS) $(CXX) -o $@ $(PROG1OBJS) $(LIBS) --- 12,16 ---- all: $(PROG1) $(PROG2) ! $(PROG1): $(PROG1OBJS) $(DEPLIBS) $(CXX) -o $@ $(PROG1OBJS) $(LIBS) |
From: Patrick C. <pa...@us...> - 2002-01-18 19:08:03
|
Update of /cvsroot/linux-decnet/dnprogs/apps In directory usw-pr-cvs1:/tmp/cvs-serv6125 Modified Files: startnet.c Log Message: Fix arg parsing and use of interfaces. Thanks to Maciej W. Rozycki Index: startnet.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/apps/startnet.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** startnet.c 2001/08/06 14:07:00 1.8 --- startnet.c 2002/01/18 19:08:00 1.9 *************** *** 41,44 **** --- 41,46 ---- } if_arg; + int force; + int hwaddr; int main(int argc, char *argv[]) *************** *** 51,54 **** --- 53,70 ---- static struct dn_naddr *binadr; + argc--; + argv++; + while (argc) + { + if (!strcmp(argv[0], "-hw")) + hwaddr = 1; + else if (!strcmp(argv[0], "-f")) + force = 1; + else + break; + argc--; + argv++; + } + if ((exec_dev=getexecdev()) == NULL) { *************** *** 124,130 **** // Setting the hardware address is common to both ! if (argc > 1 && !strcmp(argv[1], "-hw")) { ! return set_hwaddr(argc-2, argv+2); } return 0; --- 140,146 ---- // Setting the hardware address is common to both ! if (hwaddr) { ! return set_hwaddr(argc, argv); } return 0; *************** *** 149,154 **** static int set_hwaddr(int argc, char *argv[]) { ! struct ifreq ifr; ! int iindex = 1; int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); /* DECnet sockets don't allow DEV ioctls...tell Steve! */ --- 165,171 ---- static int set_hwaddr(int argc, char *argv[]) { ! struct ifconf ifc; ! struct ifreq *ifr; ! int numreqs = 30; int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); /* DECnet sockets don't allow DEV ioctls...tell Steve! */ *************** *** 156,196 **** int ifdone = 0; int ret = 0; ! int force = 0; ! /* Don't down the interface unless we have to. */ ! if (argc > 1 && strcmp(argv[0], "-f")==0) ! force = 1; ! ifr.ifr_ifindex = iindex; ! while (ioctl(sock, SIOCGIFNAME, &ifr) == 0) { /* Only use ethernet interfaces */ ! ioctl(sock, SIOCGIFHWADDR, &ifr); ! if (ifr.ifr_hwaddr.sa_family == ARPHRD_ETHER) { ! if (use_if(ifr.ifr_name, argc, argv)) { /* Down the interface so we can change the MAC address */ ! ioctl(sock, SIOCGIFFLAGS, &ifr); ! if (ifr.ifr_flags & IFF_UP && force) { ! ifr.ifr_flags &= ~IFF_UP; ! ioctl(sock, SIOCSIFFLAGS, &ifr); } /* Need to refresh this */ ! ifr.ifr_ifindex = iindex; ! ioctl(sock, SIOCGIFHWADDR, &ifr); /* Only change it if necessary */ ! if (memcmp(ifr.ifr_hwaddr.sa_data, if_arg.exec_addr, 6)) { ! memcpy(ifr.ifr_hwaddr.sa_data, if_arg.exec_addr, 6); /* Do the deed */ ! if (ioctl(sock, SIOCSIFHWADDR, &ifr) < 0) { fprintf(stderr, "Error setting hw address on %s: %s\n", ! ifr.ifr_name, strerror(errno)); ret = errno; } --- 173,225 ---- int ifdone = 0; int ret = 0; ! int i; ! ifc.ifc_buf = NULL; ! do ! { ! ifc.ifc_len = sizeof(struct ifreq) * numreqs; ! ifc.ifc_buf = realloc(ifc.ifc_buf, ifc.ifc_len); ! if (ioctl(sock, SIOCGIFCONF, &ifc) < 0) ! { ! fprintf(stderr, "Error getting interface list\n"); ! ifc.ifc_len = 0; ! ret = errno; ! break; ! } ! numreqs += 10; ! } ! while (ifc.ifc_len == sizeof(struct ifreq) * numreqs); ! ! ifr = ifc.ifc_req; ! for (i = 0; i < ifc.ifc_len; i += sizeof(struct ifreq)) { /* Only use ethernet interfaces */ ! ioctl(sock, SIOCGIFHWADDR, ifr); ! if (ifr->ifr_hwaddr.sa_family == ARPHRD_ETHER) { ! if (use_if(ifr->ifr_name, argc, argv)) { /* Down the interface so we can change the MAC address */ ! ioctl(sock, SIOCGIFFLAGS, ifr); ! if (ifr->ifr_flags & IFF_UP && force) { ! ifr->ifr_flags &= ~IFF_UP; ! ioctl(sock, SIOCSIFFLAGS, ifr); } /* Need to refresh this */ ! ioctl(sock, SIOCGIFHWADDR, ifr); /* Only change it if necessary */ ! if (memcmp(ifr->ifr_hwaddr.sa_data, if_arg.exec_addr, 6)) { ! memcpy(ifr->ifr_hwaddr.sa_data, if_arg.exec_addr, 6); /* Do the deed */ ! if (ioctl(sock, SIOCSIFHWADDR, ifr) < 0) { fprintf(stderr, "Error setting hw address on %s: %s\n", ! ifr->ifr_name, strerror(errno)); ret = errno; } *************** *** 198,209 **** /* "UP" the interface. Just in case TCP/IP is not running */ ! ioctl(sock, SIOCGIFFLAGS, &ifr); ! ifr.ifr_flags |= IFF_UP; ! ioctl(sock, SIOCSIFFLAGS, &ifr); ifdone++; } } ! ifr.ifr_ifindex = ++iindex; } --- 227,239 ---- /* "UP" the interface. Just in case TCP/IP is not running */ ! ioctl(sock, SIOCGIFFLAGS, ifr); ! ifr->ifr_flags |= IFF_UP; ! ioctl(sock, SIOCSIFFLAGS, ifr); ifdone++; } } ! ! ifr++; } |
From: Patrick C. <pa...@us...> - 2002-01-18 18:13:57
|
Update of /cvsroot/linux-decnet/dnprogs/phone In directory usw-pr-cvs1:/tmp/cvs-serv22983 Modified Files: Makefile gtkphonesig.c Log Message: Process pixmap directory properly. Patch from Maciej W. Rozycki Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/phone/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Makefile 2001/07/17 08:01:14 1.3 --- Makefile 2002/01/18 18:13:54 1.4 *************** *** 38,42 **** PROG1OBJS+=gtkphonesrc.o gtkphonesig.o phone_gtk.o GTKLIBS=$(shell gtk-config --libs) ! CFLAGS+=-DHAVE_GTK $(BINARY_PREFIX) endif --- 38,42 ---- PROG1OBJS+=gtkphonesrc.o gtkphonesig.o phone_gtk.o GTKLIBS=$(shell gtk-config --libs) ! CFLAGS+=-DHAVE_GTK $(BINARY_PREFIX) -DPIXMAPDIR=\"$(PIXMAPDIR)\" endif Index: gtkphonesig.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/phone/gtkphonesig.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** gtkphonesig.c 2000/04/26 08:22:03 1.1.1.1 --- gtkphonesig.c 2002/01/18 18:13:54 1.2 *************** *** 31,36 **** #ifndef BINARY_PREFIX ! #define BINARY_PREFIX="/usr/local" #endif GtkWidget *MainWindow; --- 31,39 ---- #ifndef BINARY_PREFIX ! #define BINARY_PREFIX "/usr/local" #endif + #ifndef PIXMAPDIR + #define PIXMAPDIR BINARY_PREFIX "/X11/pixmaps/phone" + #endif GtkWidget *MainWindow; *************** *** 59,63 **** gtk_init (&argc, &argv); ! add_pixmap_directory( BINARY_PREFIX "/X11/pixmaps/phone" ); return 1; --- 62,66 ---- gtk_init (&argc, &argv); ! add_pixmap_directory(PIXMAPDIR); return 1; |
From: Patrick C. <pa...@us...> - 2002-01-07 15:56:39
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv31247 Modified Files: Makefile rpm.spec Log Message: Add moprc to RPM and include the rpm spec file in distributions. Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/latd/Makefile,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** Makefile 2002/01/03 08:46:55 1.26 --- Makefile 2002/01/07 15:56:35 1.27 *************** *** 95,99 **** rm -rf debian/tmp cd ..; tar czf latd-$(VERSION).tar.gz latd/*.h latd/*.cc latd/*.c \ ! latd/BUGS latd/README latd/NEWS latd/Makefile \ latd/WARRANTY latd/COPYING latd/INSTALL latd/TODO \ latd/*.[1-8] latd/latd.conf latd/startlat.sh \ --- 95,99 ---- rm -rf debian/tmp cd ..; tar czf latd-$(VERSION).tar.gz latd/*.h latd/*.cc latd/*.c \ ! latd/BUGS latd/README latd/NEWS latd/Makefile latd/rpm.spec \ latd/WARRANTY latd/COPYING latd/INSTALL latd/TODO \ latd/*.[1-8] latd/latd.conf latd/startlat.sh \ Index: rpm.spec =================================================================== RCS file: /cvsroot/linux-decnet/latd/rpm.spec,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** rpm.spec 2001/02/25 12:58:16 1.2 --- rpm.spec 2002/01/07 15:56:35 1.3 *************** *** 14,21 **** --- 14,23 ---- %%PREFIX%%/sbin/latcp %%PREFIX%%/sbin/latd + %%PREFIX%%/sbin/moprc %%PREFIX%%/bin/llogin %%PREFIX%%/man/man1/llogin.1 %%PREFIX%%/man/man5/latd.conf.5 %%PREFIX%%/man/man8/latcp.8 + %%PREFIX%%/man/man8/moprc.8 %%PREFIX%%/man/man8/latd.8 /etc/latd.conf |
From: Patrick C. <pa...@us...> - 2002-01-03 16:00:02
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv1584 Modified Files: llogin.1 llogin.cc Log Message: If service password is "-" then prompt for it. Index: llogin.1 =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogin.1,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** llogin.1 2002/01/03 09:45:17 1.7 --- llogin.1 2002/01/03 15:59:57 1.8 *************** *** 1,3 **** ! .TH LLOGIN 1 "February 10 2001" "LAT utilities" .SH NAME --- 1,3 ---- ! .TH LLOGIN 1 "January 3 2002" "LAT utilities" .SH NAME *************** *** 72,76 **** .I "\-w <password>" Sends the password for the service. Only needed for services that require ! a password for access. .TP .I "\-p" --- 72,78 ---- .I "\-w <password>" Sends the password for the service. Only needed for services that require ! a password for access. If the password given is "-" then you will be prompted ! for a password and it will not be echoed. This avoids having passwords ! visible on the screen. .TP .I "\-p" Index: llogin.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogin.cc,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** llogin.cc 2002/01/03 09:45:17 1.11 --- llogin.cc 2002/01/03 15:59:57 1.12 *************** *** 1,4 **** /****************************************************************************** ! (c) 2001 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2001-2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 77,81 **** printf (" -l convert output LF to VT\n"); printf (" -n <name> Local port name\n"); ! printf (" -w <pass> Service password\n"); printf (" -q <char> quit character\n"); printf (" -h display this usage message\n"); --- 77,81 ---- printf (" -l convert output LF to VT\n"); printf (" -n <name> Local port name\n"); ! printf (" -w <pass> Service password (-w- will prompt)\n"); printf (" -q <char> quit character\n"); printf (" -h display this usage message\n"); *************** *** 186,189 **** --- 186,203 ---- do_use_port(service, quit_char, crlf, bsdel, lfvt); return 0; + } + + // If password is "-" then prompt so the user doesn't have to + // expose it on the command line. + if (password[0] == '-' && password[1] == '\0' && isatty(0)) + { + char *newpwd; + newpwd = getpass("Password: "); + if (newpwd == NULL || strlen(newpwd) > sizeof(password)) + { + printf("Password input cancelled"); + return 0; + } + strcpy(password, newpwd); } |
From: Patrick C. <pa...@us...> - 2002-01-03 09:45:21
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv10057 Modified Files: .cvsignore TODO.moprc connection.cc connection.h llogin.1 llogin.cc llogincircuit.cc llogincircuit.h lloginsession.cc lloginsession.h server.cc server.h Removed Files: portsession.cc portsession.h Log Message: Allow llogin to connect to passworded services Index: .cvsignore =================================================================== RCS file: /cvsroot/linux-decnet/latd/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** .cvsignore 2001/02/12 14:43:31 1.3 --- .cvsignore 2002/01/03 09:45:17 1.4 *************** *** 8,11 **** --- 8,12 ---- log llogin + moprc BUILD RPMS Index: TODO.moprc =================================================================== RCS file: /cvsroot/linux-decnet/latd/TODO.moprc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** TODO.moprc 2002/01/03 08:46:55 1.1 --- TODO.moprc 2002/01/03 09:45:17 1.2 *************** *** 1,2 **** Allow files as stdin for TSM-like functionality - man page --- 1 ---- Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -r1.33 -r1.34 *** connection.cc 2002/01/03 08:46:55 1.33 --- connection.cc 2002/01/03 09:45:17 1.34 *************** *** 1,4 **** /****************************************************************************** ! (c) 2000-2001 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2000-2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 943,954 **** } ! int LATConnection::create_llogin_session(int fd, char *service, char *port, char *localport) { // Create an lloginSession int newsessionnum = next_session_number(); ! LATSession *newsession = new lloginSession(*this, 0, newsessionnum, localport, fd); ! if (newsession->new_session(remnode, service, port, 0) == -1) { delete newsession; --- 943,955 ---- } ! int LATConnection::create_llogin_session(int fd, char *service, char *port, char *localport, ! char *password) { // Create an lloginSession int newsessionnum = next_session_number(); ! lloginSession *newsession = new lloginSession(*this, 0, newsessionnum, localport, fd); ! if (newsession->new_session(remnode, service, port, password, 0) == -1) { delete newsession; Index: connection.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** connection.h 2002/01/03 08:46:55 1.18 --- connection.h 2002/01/03 09:45:17 1.19 *************** *** 42,46 **** bool queued, bool clean); int connect(class ClientSession *); ! int create_llogin_session(int, char *service, char *port, char *localport); int create_localport_session(int, class LocalPort *, const char *service, const char *port, const char *localport); --- 42,46 ---- bool queued, bool clean); int connect(class ClientSession *); ! int create_llogin_session(int, char *service, char *port, char *localport, char *password); int create_localport_session(int, class LocalPort *, const char *service, const char *port, const char *localport); Index: llogin.1 =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogin.1,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** llogin.1 2002/01/03 08:46:55 1.6 --- llogin.1 2002/01/03 09:45:17 1.7 *************** *** 5,14 **** .SH SYNOPSIS ! .B llogin [options] service .br Options: .br ! [\-dvcpblhQ] [\-H node] [\-R port] [-n name] [\-q quit char] .SH DESCRIPTION .PP --- 5,14 ---- .SH SYNOPSIS ! .B llogin [options] service .br Options: .br ! [\-dvcpblhQ] [\-H node] [\-R port] [-n name] [-w password] [\-q quit char] .SH DESCRIPTION .PP *************** *** 31,35 **** .TP .I "\-R <port>" ! Connect to a specific port on (usually) a terminal server. This is the port NAME on the server and not the port number. .TP --- 31,35 ---- .TP .I "\-R <port>" ! Connect to a specific port on (usually) a terminal server. This is the port NAME on the server and not the port number. .TP *************** *** 37,47 **** Do not convert typed LF to CR. By default the enter key generates LF and llogin converts it CR as it is the most generically useful translation. ! This switch will cause the enter key to send LF instead. Occasionally useful for connecting to Unix consoles. .TP .I "\-b" Convert typed DEL to BS. By default the DEL key (keyboard, top right usually) ! send DEL (ASCII 0x7f) to the remote system. This switch will cause the DEL ! key to send BS (ASCII 8) instead. Useful for some Unix systems connected via terminal servers. .TP --- 37,47 ---- Do not convert typed LF to CR. By default the enter key generates LF and llogin converts it CR as it is the most generically useful translation. ! This switch will cause the enter key to send LF instead. Occasionally useful for connecting to Unix consoles. .TP .I "\-b" Convert typed DEL to BS. By default the DEL key (keyboard, top right usually) ! send DEL (ASCII 0x7f) to the remote system. This switch will cause the DEL ! key to send BS (ASCII 8) instead. Useful for some Unix systems connected via terminal servers. .TP *************** *** 52,59 **** .TP .I "\-q <char>" ! Change the quit character. By default CTRL-] will quit the terminal ! session. Entering a character after -q will cause CTRL-<char> to be the quit ! character for that session. -q0 will disable the quit character. If you use ! the latter, make sure you are connecting to a service that will disconnect you when you log out or you will have to kill llogin from another session to get out of it! --- 52,59 ---- .TP .I "\-q <char>" ! Change the quit character. By default CTRL-] will quit the terminal ! session. Entering a character after -q will cause CTRL-<char> to be the quit ! character for that session. -q0 will disable the quit character. If you use ! the latter, make sure you are connecting to a service that will disconnect you when you log out or you will have to kill llogin from another session to get out of it! *************** *** 61,65 **** .I "\-Q" Tells latd that the service you are connecting to is queued service and not a ! normal login service or port service. Unfortunately latd cannot tell whether a remote service needs to be queued or not so the onus is on the user to specify this switch when connecting to a queued service. --- 61,65 ---- .I "\-Q" Tells latd that the service you are connecting to is queued service and not a ! normal login service or port service. Unfortunately latd cannot tell whether a remote service needs to be queued or not so the onus is on the user to specify this switch when connecting to a queued service. *************** *** 70,78 **** so you shouldn't need to change it. .TP .I "\-p" ! Tells llogin to connect to the device named instead of a LAT service. This would usually be a /dev/lat pseudo-terminal but could be any other device ! you like really. This switch does not make the program useful as a terminal ! program because there is no way to set any serial parameters, nor am I going to add them. This is just a convenient way to use the /dev/lat ports without the overhead of programs such as minicom. --- 70,82 ---- so you shouldn't need to change it. .TP + .I "\-w <password>" + Sends the password for the service. Only needed for services that require + a password for access. + .TP .I "\-p" ! Tells llogin to connect to the device named instead of a LAT service. This would usually be a /dev/lat pseudo-terminal but could be any other device ! you like really. This switch does not make the program useful as a terminal ! program because there is no way to set any serial parameters, nor am I going to add them. This is just a convenient way to use the /dev/lat ports without the overhead of programs such as minicom. Index: llogin.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogin.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** llogin.cc 2002/01/03 08:46:55 1.10 --- llogin.cc 2002/01/03 09:45:17 1.11 *************** *** 77,80 **** --- 77,81 ---- printf (" -l convert output LF to VT\n"); printf (" -n <name> Local port name\n"); + printf (" -w <pass> Service password\n"); printf (" -q <char> quit character\n"); printf (" -h display this usage message\n"); *************** *** 89,92 **** --- 90,94 ---- char port[256] = {'\0'}; char localport[256] = {'\0'}; + char password[256] = {'\0'}; signed char opt; int verbose = 0; *************** *** 107,111 **** if (ttyname(0)) strcpy(localport, ttyname(0)); ! while ((opt=getopt(argc,argv,"dpcvhlbQH:R:r:q:n:")) != EOF) { switch(opt) --- 109,113 ---- if (ttyname(0)) strcpy(localport, ttyname(0)); ! while ((opt=getopt(argc,argv,"dpcvhlbQH:R:r:q:n:w:")) != EOF) { switch(opt) *************** *** 150,153 **** --- 152,159 ---- break; + case 'w': + strcpy(password, optarg); + break; + case 'R': case 'r': *************** *** 215,218 **** --- 221,225 ---- add_string((unsigned char*)msg, &ptr, (unsigned char*)port); add_string((unsigned char*)msg, &ptr, (unsigned char*)localport); + add_string((unsigned char*)msg, &ptr, (unsigned char*)password); send_msg(latcp_socket, LATCP_TERMINALSESSION, msg, ptr); Index: llogincircuit.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogincircuit.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** llogincircuit.cc 2002/01/03 08:46:55 1.6 --- llogincircuit.cc 2002/01/03 09:45:17 1.7 *************** *** 1,4 **** /****************************************************************************** ! (c) 2001 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2001-2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 54,62 **** debuglog(("llogin: do_command on fd %d\n", fd)); ! // Get the message header (cmd & length) if (read(fd, head, sizeof(head)) != 3) return false; // Bad header ! int len = head[1] * 256 + head[2]; unsigned char *cmdbuf = new unsigned char[len]; --- 54,62 ---- debuglog(("llogin: do_command on fd %d\n", fd)); ! // Get the message header (cmd & length) if (read(fd, head, sizeof(head)) != 3) return false; // Bad header ! int len = head[1] * 256 + head[2]; unsigned char *cmdbuf = new unsigned char[len]; *************** *** 69,73 **** } ! // Have we completed negotiation? if (head[0] != LATCP_VERSION && state != RUNNING) --- 69,73 ---- } ! // Have we completed negotiation? if (head[0] != LATCP_VERSION && state != RUNNING) *************** *** 76,82 **** return false; } ! debuglog(("llogin: do_command %d\n", head[0])); ! // Do the command switch (head[0]) --- 76,82 ---- return false; } ! debuglog(("llogin: do_command %d\n", head[0])); ! // Do the command switch (head[0]) *************** *** 118,121 **** --- 118,122 ---- get_string((unsigned char*)cmdbuf, &ptr, (unsigned char*)port); get_string((unsigned char*)cmdbuf, &ptr, (unsigned char*)localport); + get_string((unsigned char*)cmdbuf, &ptr, (unsigned char*)password); debuglog(("Terminal session for S:%s, N:%s, P:%s\n", *************** *** 124,131 **** // Do the biz if (LATServer::Instance()->make_llogin_connection(fd, ! service, node, port, localport, queued) < 0) { --- 125,133 ---- // Do the biz if (LATServer::Instance()->make_llogin_connection(fd, ! service, node, port, localport, + password, queued) < 0) { Index: llogincircuit.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogincircuit.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** llogincircuit.h 2001/03/27 10:48:49 1.2 --- llogincircuit.h 2002/01/03 09:45:17 1.3 *************** *** 1,4 **** /****************************************************************************** ! (c) 2001 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2001-2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 17,23 **** public: LLOGINCircuit(int _fd); ! virtual ~LLOGINCircuit(); ! virtual bool do_command(); --- 17,23 ---- public: LLOGINCircuit(int _fd); ! virtual ~LLOGINCircuit(); ! virtual bool do_command(); *************** *** 28,31 **** char service[256]; char port[256]; ! char localport[256]; }; --- 28,32 ---- char service[256]; char port[256]; ! char localport[256]; ! char password[256]; }; Index: lloginsession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/lloginsession.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** lloginsession.cc 2002/01/03 08:46:55 1.9 --- lloginsession.cc 2002/01/03 09:45:17 1.10 *************** *** 1,4 **** /****************************************************************************** ! (c) 2001 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2001-2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 37,41 **** #include "lat_messages.h" ! lloginSession::lloginSession(class LATConnection &p, unsigned char remid, unsigned char localid, char *lta, int fd): --- 37,41 ---- #include "lat_messages.h" ! lloginSession::lloginSession(class LATConnection &p, unsigned char remid, unsigned char localid, char *lta, int fd): *************** *** 51,56 **** } ! int lloginSession::new_session(unsigned char *_remote_node, ! char *service, char *port, unsigned char c) { --- 51,56 ---- } ! int lloginSession::new_session(unsigned char *_remote_node, ! char *service, char *port, char *password, unsigned char c) { *************** *** 58,61 **** --- 58,62 ---- strcpy(remote_service, service); strcpy(remote_port, port); + strcpy(remote_pass, password); // Make it non-blocking so we can poll it *************** *** 66,70 **** { state = STARTING; ! // Disable reads on the PTY until we are connected (or it fails) LATServer::Instance()->set_fd_state(master_fd, true); --- 67,71 ---- { state = STARTING; ! // Disable reads on the PTY until we are connected (or it fails) LATServer::Instance()->set_fd_state(master_fd, true); *************** *** 90,98 **** LAT_SessionData *reply = (LAT_SessionData *)buf; int ptr = sizeof(LAT_SessionData); ! buf[ptr++] = 0x01; // Service Class buf[ptr++] = 0x01; // Max Attention slot size buf[ptr++] = 0xfe; // Max Data slot size ! add_string(buf, &ptr, (unsigned char *)remote_service); buf[ptr++] = 0x00; // Source service length/name --- 91,99 ---- LAT_SessionData *reply = (LAT_SessionData *)buf; int ptr = sizeof(LAT_SessionData); ! buf[ptr++] = 0x01; // Service Class buf[ptr++] = 0x01; // Max Attention slot size buf[ptr++] = 0xfe; // Max Data slot size ! add_string(buf, &ptr, (unsigned char *)remote_service); buf[ptr++] = 0x00; // Source service length/name *************** *** 101,110 **** buf[ptr++] = 0x02; // Param Length 2 buf[ptr++] = 0x04; // Value 1024 ! buf[ptr++] = 0x00; // buf[ptr++] = 0x05; // Param type 5 (Local PTY name) add_string(buf, &ptr, (unsigned char*)ltaname); ! // If the user wanted a particular port number then add it // into the message if (remote_port[0] != '\0') --- 102,118 ---- buf[ptr++] = 0x02; // Param Length 2 buf[ptr++] = 0x04; // Value 1024 ! buf[ptr++] = 0x00; // buf[ptr++] = 0x05; // Param type 5 (Local PTY name) add_string(buf, &ptr, (unsigned char*)ltaname); ! // Add password if present. ! if (remote_pass[0] != '\0') ! { ! buf[ptr++] = 0x07; // Param type 7 (Service password) ! add_string(buf, &ptr, (unsigned char*)remote_pass); ! } ! ! // If the user wanted a particular port number then add it // into the message if (remote_port[0] != '\0') *************** *** 140,144 **** { debuglog(("lloginSession::disconnect_session()\n")); ! // If the reason was some sort of error then send it to // the user. if (reason > 1) --- 148,152 ---- { debuglog(("lloginSession::disconnect_session()\n")); ! // If the reason was some sort of error then send it to // the user. if (reason > 1) *************** *** 162,166 **** void lloginSession::do_read() { ! read_pty(); } --- 170,174 ---- void lloginSession::do_read() { ! read_pty(); } *************** *** 172,176 **** len = snprintf(buffer, sizeof(buffer), "LAT: You are queued for node %s, position %d\n", node, entry->max_que_pos); ! write(master_fd, buffer, len); have_been_queued = true; --- 180,184 ---- len = snprintf(buffer, sizeof(buffer), "LAT: You are queued for node %s, position %d\n", node, entry->max_que_pos); ! write(master_fd, buffer, len); have_been_queued = true; Index: lloginsession.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/lloginsession.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** lloginsession.h 2002/01/03 08:46:55 1.5 --- lloginsession.h 2002/01/03 09:45:17 1.6 *************** *** 1,4 **** /****************************************************************************** ! (c) 2001 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2001-2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 21,25 **** virtual ~lloginSession(); virtual int new_session(unsigned char *remote_node, ! char *service, char *port, unsigned char c); virtual void do_read(); virtual void disconnect_session(int reason); --- 21,25 ---- virtual ~lloginSession(); virtual int new_session(unsigned char *remote_node, ! char *service, char *port, char *password, unsigned char c); virtual void do_read(); virtual void disconnect_session(int reason); *************** *** 34,37 **** bool have_been_queued; ! }; --- 34,37 ---- bool have_been_queued; ! char remote_pass[256]; }; Index: server.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.cc,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -r1.46 -r1.47 *** server.cc 2002/01/03 08:46:55 1.46 --- server.cc 2002/01/03 09:45:17 1.47 *************** *** 1,4 **** /****************************************************************************** ! (c) 2001 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2001-2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 1499,1503 **** int LATServer::make_llogin_connection(int fd, char *service, char *rnode, char *port, ! char *localport, bool queued) { int ret; --- 1499,1503 ---- int LATServer::make_llogin_connection(int fd, char *service, char *rnode, char *port, ! char *localport, char *password, bool queued) { int ret; *************** *** 1555,1559 **** debuglog(("lloginSession for %s has connid %d\n", service, connid)); ! ret = connections[connid]->create_llogin_session(fd, service, port, localport); // Remove LLOGIN socket from the list as it's now been --- 1555,1559 ---- debuglog(("lloginSession for %s has connid %d\n", service, connid)); ! ret = connections[connid]->create_llogin_session(fd, service, port, localport, password); // Remove LLOGIN socket from the list as it's now been Index: server.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** server.h 2002/01/03 08:46:55 1.30 --- server.h 2002/01/03 09:45:17 1.31 *************** *** 273,277 **** int create_local_port(unsigned char *, unsigned char *, unsigned char *, unsigned char *, bool, bool); ! int make_llogin_connection(int fd, char *, char *, char *, char *, bool); int make_port_connection(int fd, LocalPort *, const char *, const char *, const char *, const char *, bool); --- 273,277 ---- int create_local_port(unsigned char *, unsigned char *, unsigned char *, unsigned char *, bool, bool); ! int make_llogin_connection(int fd, char *, char *, char *, char *, char *, bool); int make_port_connection(int fd, LocalPort *, const char *, const char *, const char *, const char *, bool); --- portsession.cc DELETED --- --- portsession.h DELETED --- |
From: Patrick C. <pa...@us...> - 2002-01-03 09:45:21
|
Update of /cvsroot/linux-decnet/latd/debian In directory usw-pr-cvs1:/tmp/cvs-serv10057/debian Modified Files: changelog Log Message: Allow llogin to connect to passworded services Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/latd/debian/changelog,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** changelog 2002/01/03 08:46:56 1.3 --- changelog 2002/01/03 09:45:17 1.4 *************** *** 3,6 **** --- 3,7 ---- * llogin -r is an alias for llogin -R (easier to type!) * New moprc program for remote administration of terminal servers + * llogin can now connect to passworded services using llogin -w -- |
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv31180 Modified Files: Makefile NEWS TODO circuit.cc clientsession.cc clientsession.h connection.cc connection.h lat.h latcp.8 latcp.cc latcpcircuit.cc llogin.1 llogin.cc llogincircuit.cc lloginsession.cc lloginsession.h main.cc server.cc server.h serversession.cc serversession.h services.cc services.h session.cc session.h Added Files: TODO.moprc localport.cc localport.h localportsession.cc localportsession.h moprc.8 moprc.c moprc.h queuedsession.cc queuedsession.h Log Message: Move files from 1.10 branch to the head where they belong. The 1.0 version is now on TAG_LATD_BRANCH_1_0. --- NEW FILE: TODO.moprc --- Allow files as stdin for TSM-like functionality man page Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/latd/Makefile,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** Makefile 2002/01/03 08:36:33 1.25 --- Makefile 2002/01/03 08:46:55 1.26 *************** *** 1,5 **** # Makefile for LAT server ! VERSION=1.04 PKGNAME=latd --- 1,5 ---- # Makefile for LAT server ! VERSION=1.12 PKGNAME=latd *************** *** 8,23 **** PROG2=latcp PROG3=llogin MANPAGES1=llogin.1 MANPAGES5=latd.conf.5 ! MANPAGES8=latd.8 latcp.8 PROG1OBJS=main.o utils.o server.o connection.o session.o \ ! serversession.o clientsession.o portsession.o services.o \ ! latcpcircuit.o lat_messages.o lloginsession.o llogincircuit.o circuit.o PROG2OBJS=latcp.o utils.o PROG3OBJS=llogin.o utils.o DEFS=-DVERSION=\"$(VERSION)\" -DLATCP_SOCKNAME=\"$(LATCPSOCK)\" -DLLOGIN_SOCKNAME=\"$(LLOGINSOCK)\" DEFS+=-DUSE_OPENPTY #-DSETLOGIN_HOST #DEFS+=-DVERBOSE_DEBUG -DNO_FORK -DDEBUG_MALLOC prefix=/usr/local --- 8,27 ---- PROG2=latcp PROG3=llogin + PROG4=moprc MANPAGES1=llogin.1 MANPAGES5=latd.conf.5 ! MANPAGES8=latd.8 latcp.8 moprc.8 PROG1OBJS=main.o utils.o server.o connection.o session.o \ ! serversession.o clientsession.o queuedsession.o services.o \ ! latcpcircuit.o lat_messages.o lloginsession.o llogincircuit.o \ ! circuit.o localport.o localportsession.o PROG2OBJS=latcp.o utils.o PROG3OBJS=llogin.o utils.o + PROG4OBJS=moprc.o DEFS=-DVERSION=\"$(VERSION)\" -DLATCP_SOCKNAME=\"$(LATCPSOCK)\" -DLLOGIN_SOCKNAME=\"$(LLOGINSOCK)\" DEFS+=-DUSE_OPENPTY #-DSETLOGIN_HOST #DEFS+=-DVERBOSE_DEBUG -DNO_FORK -DDEBUG_MALLOC + #DEFS+=-DREALLY_VERBOSE_DEBUGLOG prefix=/usr/local *************** *** 26,30 **** --- 30,36 ---- OPTDEBUG=-g CXX=g++ + CC=gcc CXXFLAGS+=$(OPTDEBUG) $(DEFS) -pipe -Wstrict-prototypes -Wall -fno-rtti -fno-exceptions + CFLAGS+=$(OPTDEBUG) $(DEFS) -pipe -Wstrict-prototypes -Wall # ARCH code taken from the Linux kernel sources. *************** *** 47,51 **** # Targets: # ! all: $(PROG1) $(PROG2) $(PROG3) $(PROG1): depend $(PROG1OBJS) --- 53,57 ---- # Targets: # ! all: $(PROG1) $(PROG2) $(PROG3) $(PROG4) $(PROG1): depend $(PROG1OBJS) *************** *** 58,61 **** --- 64,70 ---- $(CXX) -o $@ $(PROG3OBJS) + $(PROG4): depend $(PROG4OBJS) + $(CC) $(CFLAGS) -o $@ $(PROG4OBJS) + install: install -d $(prefix)/sbin *************** *** 67,70 **** --- 76,80 ---- install -m 0750 -s $(PROG2) $(prefix)/sbin install -m 0755 -s $(PROG3) $(prefix)/bin + install -m 0750 -s $(PROG4) $(prefix)/sbin install -m 0644 $(MANPAGES1) $(prefix)/man/man1 install -m 0644 $(MANPAGES5) $(prefix)/man/man5 *************** *** 76,86 **** clean: rm -f .depend ! rm -f $(PROG1) $(PROG2) $(PROG3) *.o *.bak .depend rm -rf debian/tmp dist: rm -f .depend rm -rf debian/tmp ! cd ..; tar czf latd-$(VERSION).tar.gz latd/*.h latd/*.cc \ latd/BUGS latd/README latd/NEWS latd/Makefile \ latd/WARRANTY latd/COPYING latd/INSTALL latd/TODO \ --- 86,98 ---- clean: rm -f .depend ! rm -f $(PROG1) $(PROG2) $(PROG3) *.o *.bak .depend core rm -rf debian/tmp + debclean: + debian/rules clean dist: rm -f .depend rm -rf debian/tmp ! cd ..; tar czf latd-$(VERSION).tar.gz latd/*.h latd/*.cc latd/*.c \ latd/BUGS latd/README latd/NEWS latd/Makefile \ latd/WARRANTY latd/COPYING latd/INSTALL latd/TODO \ Index: NEWS =================================================================== RCS file: /cvsroot/linux-decnet/latd/NEWS,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** NEWS 2002/01/03 08:36:33 1.21 --- NEWS 2002/01/03 08:46:55 1.22 *************** *** 1,2 **** --- 1,21 ---- + latd (1.11-1) unstable; urgency=low + + * Added -l switch to llogin to replace LF with VT + * Document -d -v switch to llogin + * Renamed PortSession to QueuedSession so it's less confusing + * /dev/lat ports connect using LocalPort and localportSession so they + can share connections. + * Fixed spurious newlines generated by llogin -p + + -- Patrick Caulfield <pa...@de...> Wed, 26 Sep 2001 14:37:43 +0100 + + latd (1.10-1) unstable; urgency=low + + * Can now handle multiple reverse-LAT connections via the same connection + (llogin only) + * Can specify a command to run (and user to run it under) for a named service. + + -- Patrick Caulfield <pa...@de...> Thu, 16 Aug 2001 11:54:28 +0100 + latd (1.03-1) unstable; urgency=low Index: TODO =================================================================== RCS file: /cvsroot/linux-decnet/latd/TODO,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** TODO 2001/02/19 19:17:02 1.11 --- TODO 2002/01/03 08:46:55 1.12 *************** *** 2,8 **** ---- ! - Check multiple sessions on the same connection. How many slots can I ! get away with sending? (and stuff like that) ! - Test service responder - can someone do this for me please?? THINGS I MAY NOT DO --- 2,8 ---- ---- ! - Test service responder. ! - Allow reverse-LAT to DECserver 90L+ ! - Find out we send so many more packets than Tru64 THINGS I MAY NOT DO *************** *** 11,15 **** - Support windows larger than 1 - Allow /etc/issue.net files longer than 255 characters - - Support multiple client sessions in one connection - (see BUGS for implications of this) - Put the protocol bits into the kernel. --- 11,13 ---- Index: circuit.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/circuit.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** circuit.cc 2001/02/09 19:59:50 1.1 --- circuit.cc 2002/01/03 08:46:55 1.2 *************** *** 28,31 **** --- 28,32 ---- #include "services.h" #include "session.h" + #include "localport.h" #include "connection.h" #include "circuit.h" Index: clientsession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/clientsession.cc,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** clientsession.cc 2001/02/25 12:57:55 1.23 --- clientsession.cc 2002/01/03 08:46:55 1.24 *************** *** 1,4 **** /****************************************************************************** ! (c) 2000 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2001 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 28,31 **** --- 28,32 ---- #include "utils.h" #include "session.h" + #include "localport.h" #include "connection.h" #include "circuit.h" *************** *** 35,39 **** #include "lat_messages.h" ! ClientSession::ClientSession(class LATConnection &p, unsigned char remid, unsigned char localid, char *ttyname, bool clean): --- 36,40 ---- #include "lat_messages.h" ! ClientSession::ClientSession(class LATConnection &p, unsigned char remid, unsigned char localid, char *ttyname, bool clean): *************** *** 46,52 **** } ! int ClientSession::new_session(unsigned char *_remote_node, unsigned char c) { credit = c; // A quick word of explanation here. --- 47,63 ---- } ! // This should never be called now as it is overridden ! // by all self-respecting superclasses. ! int ClientSession::new_session(unsigned char *_remote_node, ! char *service, char *port, ! unsigned char c) { + + assert(!"Should never get here!!"); + + credit = c; + strcpy(remote_service, service); + strcpy(remote_port, port); // A quick word of explanation here. *************** *** 59,64 **** &slave_fd, NULL, NULL, NULL) != 0) return -1; /* REJECT */ - // Set terminal characteristics struct termios tio; --- 70,75 ---- &slave_fd, NULL, NULL, NULL) != 0) return -1; /* REJECT */ + // Set terminal characteristics struct termios tio; *************** *** 70,76 **** strcpy(ptyname, ttyname(slave_fd)); strcpy(mastername, ttyname(master_fd)); ! state = STARTING; slave_fd_open = true; ! // Check for /dev/lat & create it if necessary struct stat st; --- 81,87 ---- strcpy(ptyname, ttyname(slave_fd)); strcpy(mastername, ttyname(master_fd)); ! state = NEW; slave_fd_open = true; ! // Check for /dev/lat & create it if necessary struct stat st; *************** *** 103,107 **** debuglog(("made symlink %s to %s\n", ltaname, ptyname)); ! LATServer::Instance()->add_pty(this, master_fd); return 0; } --- 114,118 ---- debuglog(("made symlink %s to %s\n", ltaname, ptyname)); ! // LATServer::Instance()->add_pty(this, master_fd); return 0; } *************** *** 110,119 **** { debuglog(("connecting parent for %s\n", ltaname)); ! return parent.connect(); } ! void ClientSession::connect(char *service, char *port) { ! debuglog(("connecting client session to '%s'\n", remote_node)); // OK, now send a Start message to the remote end. --- 121,131 ---- { debuglog(("connecting parent for %s\n", ltaname)); ! return parent.connect(this); } ! void ClientSession::connect() { ! state = RUNNING; ! debuglog(("connecting client session to '%s'\n", remote_service)); // OK, now send a Start message to the remote end. *************** *** 122,131 **** LAT_SessionData *reply = (LAT_SessionData *)buf; int ptr = sizeof(LAT_SessionData); ! buf[ptr++] = 0x01; // Service Class buf[ptr++] = 0x01; // Max Attention slot size.. buf[ptr++] = 0xfe; // Max Data slot size ! ! add_string(buf, &ptr, (unsigned char *)service); buf[ptr++] = 0x00; // Source service length/name --- 134,143 ---- LAT_SessionData *reply = (LAT_SessionData *)buf; int ptr = sizeof(LAT_SessionData); ! buf[ptr++] = 0x01; // Service Class buf[ptr++] = 0x01; // Max Attention slot size.. buf[ptr++] = 0xfe; // Max Data slot size ! ! add_string(buf, &ptr, (unsigned char *)remote_service); buf[ptr++] = 0x00; // Source service length/name *************** *** 133,150 **** buf[ptr++] = 0x02; // Param Length 2 buf[ptr++] = 0x04; // Value 1024 ! buf[ptr++] = 0x00; // buf[ptr++] = 0x05; // Param type 5 (Local PTY name) add_string(buf, &ptr, (unsigned char *)ltaname); ! // If the user wanted a particular port number then add it // into the message ! if (port[0] != '\0') { buf[ptr++] = 0x04; // Param type 4 (Remote port name) ! add_string(buf, &ptr, (unsigned char *)port); buf[ptr++] = 0x00; // NUL terminated (??) } ! // Send message... reply->header.cmd = LAT_CCMD_SESSION; --- 145,162 ---- buf[ptr++] = 0x02; // Param Length 2 buf[ptr++] = 0x04; // Value 1024 ! buf[ptr++] = 0x00; // buf[ptr++] = 0x05; // Param type 5 (Local PTY name) add_string(buf, &ptr, (unsigned char *)ltaname); ! // If the user wanted a particular port number then add it // into the message ! if (remote_port[0] != '\0') { buf[ptr++] = 0x04; // Param type 4 (Remote port name) ! add_string(buf, &ptr, (unsigned char *)remote_port); buf[ptr++] = 0x00; // NUL terminated (??) } ! // Send message... reply->header.cmd = LAT_CCMD_SESSION; *************** *** 162,180 **** void ClientSession::restart_pty() { ! debuglog(("ClientSession::restart_pty()\n")); connected = false; remote_session = 0; ! // Close it all down so the local side gets EOF unlink(ltaname); ! if (slave_fd_open) close (slave_fd); close (master_fd); LATServer::Instance()->set_fd_state(master_fd, true); LATServer::Instance()->remove_fd(master_fd); - - // Now open it all up again ready for a new connection - new_session((unsigned char *)remote_node, 0); } --- 174,191 ---- void ClientSession::restart_pty() { ! assert(!"ClientSession::restart_pty()\n"); connected = false; remote_session = 0; ! // Close it all down so the local side gets EOF unlink(ltaname); ! if (slave_fd_open) close (slave_fd); close (master_fd); LATServer::Instance()->set_fd_state(master_fd, true); LATServer::Instance()->remove_fd(master_fd); + // Now open it all up again ready for a new connection + new_session((unsigned char *)remote_node, remote_service, remote_port, 0); } *************** *** 184,188 **** { debuglog(("ClientSession::disconnect_session()\n")); ! // If the reason was some sort of error then send it to // the PTY if (reason > 1) --- 195,199 ---- { debuglog(("ClientSession::disconnect_session()\n")); ! // If the reason was some sort of error then send it to // the PTY if (reason > 1) *************** *** 201,209 **** ClientSession::~ClientSession() { - if (ltaname[0]) unlink(ltaname); - if (slave_fd_open) close (slave_fd); ! close (master_fd); ! LATServer::Instance()->remove_fd(master_fd); } --- 212,221 ---- ClientSession::~ClientSession() { if (slave_fd_open) close (slave_fd); ! if (master_fd > -1) ! { ! close (master_fd); ! LATServer::Instance()->remove_fd(master_fd); ! } } *************** *** 216,220 **** { state = STARTING; ! // Disable reads on the PTY until we are connected (or it fails) LATServer::Instance()->set_fd_state(master_fd, true); --- 228,232 ---- { state = STARTING; ! // Disable reads on the PTY until we are connected (or it fails) LATServer::Instance()->set_fd_state(master_fd, true); *************** *** 265,269 **** slotbuf[slotptr++] = 0x13; // Stop input char XOFF slotbuf[slotptr++] = 0x11; // Start input char XON ! add_slot(buf, ptr, 0xaf, slotbuf, slotptr); credit--; --- 277,281 ---- slotbuf[slotptr++] = 0x13; // Stop input char XOFF slotbuf[slotptr++] = 0x11; // Start input char XON ! add_slot(buf, ptr, 0xaf, slotbuf, slotptr); credit--; *************** *** 274,278 **** } ! // Called from the slave connection - return the master fd so it can // can do I/O on it and close the slave so it gets EOF notification. int ClientSession::get_port_fd() --- 286,290 ---- } ! // Called from the slave connection - return the master fd so it can // can do I/O on it and close the slave so it gets EOF notification. int ClientSession::get_port_fd() *************** *** 282,287 **** } ! // Normal client sessions don't provide feedback on status (though maybe we should ! // check for other status types.... void ClientSession::show_status(unsigned char *node, LAT_StatusEntry *entry) { --- 294,299 ---- } ! // Normal client sessions don't provide feedback on status (though maybe we ! // should check for other status types.... void ClientSession::show_status(unsigned char *node, LAT_StatusEntry *entry) { Index: clientsession.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/clientsession.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** clientsession.h 2001/03/27 10:48:49 1.12 --- clientsession.h 2002/01/03 08:46:55 1.13 *************** *** 20,28 **** virtual ~ClientSession(); ! virtual int new_session(unsigned char *remote_node, unsigned char c); virtual void do_read(); virtual void disconnect_session(int reason); ! ! virtual void connect(char *service, char *port); virtual int connect_parent(); virtual void got_connection(unsigned char); --- 20,29 ---- virtual ~ClientSession(); ! virtual int new_session(unsigned char *remote_node, ! char *service, char *port, unsigned char c); virtual void do_read(); virtual void disconnect_session(int reason); ! ! virtual void connect(); virtual int connect_parent(); virtual void got_connection(unsigned char); *************** *** 32,38 **** int get_port_fd(); ! protected: char ltaname[255]; ! private: int slave_fd; --- 33,39 ---- int get_port_fd(); ! protected: char ltaname[255]; ! private: int slave_fd; Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** connection.cc 2001/06/22 15:26:06 1.32 --- connection.cc 2002/01/03 08:46:55 1.33 *************** *** 1,4 **** /****************************************************************************** ! (c) 2001 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2000-2001 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** [...1410 lines suppressed...] ! output << lta_name << std::setw(24-strlen((char*)lta_name)) << " " << servicename ! << std::setw(16-strlen((char*)servicename)) << " " ! << remnode << std::setw(16-strlen((char*)remnode)) << " " << portname ! << std::setw(16-strlen((char*)portname)) << " " << (queued?"Yes":"No ") ! << (eightbitclean?" 8":" ") << std::endl; } --- 1063,1074 ---- } ! int LATConnection::num_clients() { ! unsigned int i; ! int num = 0; ! for (i=1; i<=highest_session; i++) ! if (sessions[i]) num++; ! return num; } Index: connection.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** connection.h 2001/06/22 15:26:06 1.17 --- connection.h 2002/01/03 08:46:55 1.18 *************** *** 1,4 **** /****************************************************************************** ! (c) 2000 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2000-2001 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 19,23 **** typedef enum {REPLY, DATA, CONTINUATION} send_type; ! LATConnection(int _num, unsigned char *buf, int len, int _interface, --- 19,23 ---- typedef enum {REPLY, DATA, CONTINUATION} send_type; ! LATConnection(int _num, unsigned char *buf, int len, int _interface, *************** *** 30,33 **** --- 30,34 ---- int send_message(unsigned char *, int, send_type); int queue_message(unsigned char *, int); + int add_data_slots(int start_slot, LAT_SlotCmd *slots[4]); void send_slot_message(unsigned char *, int); void circuit_timer(); *************** *** 40,54 **** const char *_lta, const char *remnode, bool queued, bool clean); ! int connect(); ! int create_client_session(); ! int create_llogin_session(int); int disconnect_client(); // From LATServer int got_connect_ack(unsigned char *); // Callback from LATServer bool isClient() { return role==CLIENT;} const char *getLocalPortName() { return lta_name; } - void show_client_info(bool verbose, std::ostrstream &); int get_connection_id() { return num;} void got_status(unsigned char *node, LAT_StatusEntry *entry); ! private: int num; // Local connection ID --- 41,58 ---- const char *_lta, const char *remnode, bool queued, bool clean); ! int connect(class ClientSession *); ! int create_llogin_session(int, char *service, char *port, char *localport); ! int create_localport_session(int, class LocalPort *, const char *service, ! const char *port, const char *localport); int disconnect_client(); // From LATServer int got_connect_ack(unsigned char *); // Callback from LATServer bool isClient() { return role==CLIENT;} const char *getLocalPortName() { return lta_name; } int get_connection_id() { return num;} void got_status(unsigned char *node, LAT_StatusEntry *entry); ! bool node_is(const char *node) { return strcmp(node, (char *)remnode)==0;} ! int num_clients(); ! const char *get_servicename() { return (const char *)servicename; } ! private: int num; // Local connection ID *************** *** 59,62 **** --- 63,67 ---- unsigned char last_ack_number; unsigned int next_session; + unsigned int highest_session; unsigned char macaddr[6]; unsigned char servicename[255]; *************** *** 71,80 **** bool queued_slave; // We are a slave connection for a queued client bool eightbitclean; ! LATConnection *master_conn; // Client connection we a re slave to ! int next_session_number(); void send_a_reply(unsigned char local_session, unsigned char remote_session); bool is_queued_reconnect(unsigned char *buf, int len, int *conn); ! static const unsigned int MAX_SESSIONS = 254; enum {CLIENT, SERVER} role; --- 76,87 ---- bool queued_slave; // We are a slave connection for a queued client bool eightbitclean; ! bool connected; ! LATConnection *master_conn; // Client connection we are slave to ! bool connecting; ! int next_session_number(); void send_a_reply(unsigned char local_session, unsigned char remote_session); bool is_queued_reconnect(unsigned char *buf, int len, int *conn); ! static const unsigned int MAX_SESSIONS = 254; enum {CLIENT, SERVER} role; *************** *** 84,88 **** { public: ! pending_msg() {} pending_msg(unsigned char *_buf, int _len, bool _need_ack): len(_len), --- 91,95 ---- { public: ! pending_msg() {} pending_msg(unsigned char *_buf, int _len, bool _need_ack): len(_len), *************** *** 93,97 **** pending_msg(const pending_msg &msg): len(msg.len), ! need_ack(msg.need_ack) { memcpy(buf, msg.buf, len); --- 100,104 ---- pending_msg(const pending_msg &msg): len(msg.len), ! need_ack(msg.need_ack) { memcpy(buf, msg.buf, len); *************** *** 111,115 **** return *this; } ! int send(int interface, unsigned char *macaddr); int send(int interface, unsigned char seq, unsigned char *macaddr) --- 118,122 ---- return *this; } ! int send(int interface, unsigned char *macaddr); int send(int interface, unsigned char seq, unsigned char *macaddr) *************** *** 121,125 **** LAT_Header *get_header() { return (LAT_Header *)buf;} bool needs_ack() { return need_ack;} ! private: unsigned char buf[1600]; --- 128,132 ---- LAT_Header *get_header() { return (LAT_Header *)buf;} bool needs_ack() { return need_ack;} ! private: unsigned char buf[1600]; *************** *** 145,149 **** memcpy(buf, cmd.buf, len); } ! ~slot_cmd() { --- 152,156 ---- memcpy(buf, cmd.buf, len); } ! ~slot_cmd() { *************** *** 153,164 **** unsigned char *get_buf(){return buf;} LAT_SlotCmd *get_cmd(){return (LAT_SlotCmd *)buf;} ! private: unsigned char buf[300]; ! int len; }; std::queue<slot_cmd> slots_pending; ! int max_window_size; // As set by the client. int window_size; // Current window size --- 160,171 ---- unsigned char *get_buf(){return buf;} LAT_SlotCmd *get_cmd(){return (LAT_SlotCmd *)buf;} ! private: unsigned char buf[300]; ! int len; }; std::queue<slot_cmd> slots_pending; ! int max_window_size; // As set by the client. int window_size; // Current window size Index: lat.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/lat.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** lat.h 2001/02/19 11:47:13 1.7 --- lat.h 2002/01/03 08:46:55 1.8 *************** *** 30,34 **** typedef struct { ! unsigned char cmd __attribute__ ((packed)); unsigned char num_slots __attribute__ ((packed)); unsigned short remote_connid __attribute__ ((packed)); --- 30,34 ---- typedef struct { ! unsigned char cmd __attribute__ ((packed)); unsigned char num_slots __attribute__ ((packed)); unsigned short remote_connid __attribute__ ((packed)); *************** *** 53,57 **** unsigned char multicast_timer __attribute__ ((packed)); // Multicast timer (seconds) unsigned char node_status __attribute__ ((packed)); // 2 (accepting connections) ! unsigned char group_length __attribute__ ((packed)); // Following: --- 53,57 ---- unsigned char multicast_timer __attribute__ ((packed)); // Multicast timer (seconds) unsigned char node_status __attribute__ ((packed)); // 2 (accepting connections) ! unsigned char group_length __attribute__ ((packed)); // Following: *************** *** 140,144 **** unsigned short entry_id __attribute__ ((packed)); unsigned char opcode __attribute__ ((packed)); ! unsigned char modifier __attribute__ ((packed)); // ASCIC Destination node name // ASCIC Source node name --- 140,144 ---- unsigned short entry_id __attribute__ ((packed)); unsigned char opcode __attribute__ ((packed)); ! unsigned char modifier __attribute__ ((packed)); // ASCIC Destination node name // ASCIC Source node name *************** *** 162,166 **** // ASCIC Port Name // ASCIC Service description ! } LAT_StatusEntry; --- 162,166 ---- // ASCIC Port Name // ASCIC Service description ! } LAT_StatusEntry; Index: latcp.8 =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcp.8,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** latcp.8 2001/02/12 15:24:10 1.7 --- latcp.8 2002/01/03 08:46:55 1.8 *************** *** 42,46 **** The syntax for creating a login service is: .br ! latcp -A -a service [-i description] [-r rating] [-s] .br The --- 42,46 ---- The syntax for creating a login service is: .br ! latcp -A -a service [-i description] [-r rating] [-s] [-C command] [-u user] .br The *************** *** 50,53 **** --- 50,62 ---- the the load average of the machine. .br + The + .B -C + flag indicates a command to run when a user connects to the service - by + default this is /bin/login. + .br. + The + .B -u + flag specifies a user to runthe above command as. By default this will be root. + .br The syntax for creating a reverse LAT port is: .br *************** *** 63,67 **** .B -8 flag tells latd not to muck about with the data. Normally latd will ! transmit a BREAK if a NUL character is sent, .B -8 disables this behaviour for ports with (eg) printers or modems attached. --- 72,76 ---- .B -8 flag tells latd not to muck about with the data. Normally latd will ! transmit a BREAK if a NUL character is typed, .B -8 disables this behaviour for ports with (eg) printers or modems attached. Index: latcp.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcp.cc,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** latcp.cc 2001/02/12 15:24:10 1.26 --- latcp.cc 2002/01/03 08:46:55 1.27 *************** *** 1,4 **** /****************************************************************************** ! (c) 2000 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2000-2001 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 36,39 **** --- 36,40 ---- #include <stdlib.h> #include <utmp.h> + #include <pwd.h> #include <signal.h> #include <limits.h> *************** *** 90,96 **** printf (" -s [<latd args>]\n"); printf (" -h\n"); ! printf (" -A -a service [-i description] [-r rating] [-s]\n"); printf (" -A -p tty -V learned_service [-R rem_port] [-H rem_node] [-Q] [-8]\n"); printf (" -D {-a service | -p tty}\n"); printf (" -i description -a service\n"); printf (" -g list\n"); --- 91,98 ---- printf (" -s [<latd args>]\n"); printf (" -h\n"); ! printf (" -A -a service [-i description] [-r rating] [-s] [-C command] [-u user] [-m max conn]\n"); printf (" -A -p tty -V learned_service [-R rem_port] [-H rem_node] [-Q] [-8]\n"); printf (" -D {-a service | -p tty}\n"); + printf (" -C service command}\n"); printf (" -i description -a service\n"); printf (" -g list\n"); *************** *** 117,121 **** // Parse the command. // because the args vary so much for each command I just check argv[1] ! // for the command switch and the command processors call getopt themselves if (argc == 1) --- 119,123 ---- // Parse the command. // because the args vary so much for each command I just check argv[1] ! // for the command switch and the command processors call getopt themselves if (argc == 1) *************** *** 200,204 **** exit(usage(argv[0])); break; ! } } --- 202,206 ---- exit(usage(argv[0])); break; ! } } *************** *** 206,219 **** // Display latd characteristics or learned services void display(int argc, char *argv[]) ! { char verboseflag[1] = {'\0'}; signed char opt; bool show_services = false; ! if (!open_socket(false)) return; while ((opt=getopt(argc,argv,"lv")) != EOF) { ! switch(opt) { case 'l': --- 208,221 ---- // Display latd characteristics or learned services void display(int argc, char *argv[]) ! { char verboseflag[1] = {'\0'}; signed char opt; bool show_services = false; ! if (!open_socket(false)) return; while ((opt=getopt(argc,argv,"lv")) != EOF) { ! switch(opt) { case 'l': *************** *** 248,252 **** cout << result; ! delete[] result; } --- 250,254 ---- cout << result; ! delete[] result; } *************** *** 259,268 **** char service[256]; signed char opt; ! if (!open_socket(false)) return; while ((opt=getopt(argc,argv,"x:sa:")) != EOF) { ! switch(opt) { case 'x': --- 261,270 ---- char service[256]; signed char opt; ! if (!open_socket(false)) return; while ((opt=getopt(argc,argv,"x:sa:")) != EOF) { ! switch(opt) { case 'x': *************** *** 292,296 **** make_upper(service); ! char message[520]; int ptr = 2; --- 294,298 ---- make_upper(service); ! char message[520]; int ptr = 2; *************** *** 306,310 **** exit (read_reply(latcp_socket, cmd, result, len)); ! } --- 308,312 ---- exit (read_reply(latcp_socket, cmd, result, len)); ! } *************** *** 316,325 **** char ident[256]; signed char opt; ! if (!open_socket(false)) return; while ((opt=getopt(argc,argv,"i:a:")) != EOF) { ! switch(opt) { case 'a': --- 318,327 ---- char ident[256]; signed char opt; ! if (!open_socket(false)) return; while ((opt=getopt(argc,argv,"i:a:")) != EOF) { ! switch(opt) { case 'a': *************** *** 338,342 **** make_upper(service); ! char message[1024]; int ptr = 0; --- 340,344 ---- make_upper(service); ! char message[1024]; int ptr = 0; *************** *** 358,365 **** int cmd; char groups[256]; ! while ((opt=getopt(argc,argv,"G:g:")) != EOF) { ! switch(opt) { case 'G': --- 360,367 ---- int cmd; char groups[256]; ! while ((opt=getopt(argc,argv,"G:g:")) != EOF) { ! switch(opt) { case 'G': *************** *** 383,387 **** char bitmap[32]; // 256 bits make_bitmap(bitmap, groups); ! send_msg(latcp_socket, cmd, bitmap, 32); --- 385,389 ---- char bitmap[32]; // 256 bits make_bitmap(bitmap, groups); ! send_msg(latcp_socket, cmd, bitmap, 32); *************** *** 398,405 **** int cmd; char groups[256]; ! while ((opt=getopt(argc,argv,"u:U:")) != EOF) { ! switch(opt) { case 'U': --- 400,407 ---- int cmd; char groups[256]; ! while ((opt=getopt(argc,argv,"u:U:")) != EOF) { ! switch(opt) { case 'U': *************** *** 423,427 **** char bitmap[32]; // 256 bits make_bitmap(bitmap, groups); ! send_msg(latcp_socket, cmd, bitmap, 32); --- 425,429 ---- char bitmap[32]; // 256 bits make_bitmap(bitmap, groups); ! send_msg(latcp_socket, cmd, bitmap, 32); *************** *** 440,444 **** char flag[1]; flag[0] = onoff; ! send_msg(latcp_socket, LATCP_SETRESPONDER, flag, 1); } --- 442,446 ---- char flag[1]; flag[0] = onoff; ! send_msg(latcp_socket, LATCP_SETRESPONDER, flag, 1); } *************** *** 502,510 **** make_upper(name); ! char message[520]; int ptr = 0; add_string((unsigned char*)message, &ptr, (unsigned char*)name); ! send_msg(latcp_socket, LATCP_SETNODENAME, message, ptr); return; --- 504,512 ---- make_upper(name); ! char message[520]; int ptr = 0; add_string((unsigned char*)message, &ptr, (unsigned char*)name); ! send_msg(latcp_socket, LATCP_SETNODENAME, message, ptr); return; *************** *** 519,522 **** --- 521,525 ---- char remnode[255] = {'\0'}; char remservice[255] = {'\0'}; + char command[1024] = {'\0'}; signed char opt; bool got_service=false; *************** *** 526,536 **** int queued = 0; int clean = 0; ! opterr = 0; optind = 0; ! while ((opt=getopt(argc,argv,"a:i:p:H:R:V:r:sQ8")) != EOF) { ! switch(opt) { case 'a': --- 529,544 ---- int queued = 0; int clean = 0; ! int max_connections = 0; ! uid_t target_uid = 0; ! gid_t target_gid = 0; ! struct passwd *target_user; ! ! opterr = 0; optind = 0; ! while ((opt=getopt(argc,argv,"a:i:p:H:R:V:r:sQ8C:m:u:")) != EOF) { ! switch(opt) { case 'a': *************** *** 586,598 **** break; case 'r': rating = atoi(optarg); break; ! default: fprintf(stderr, "No more service switches defined yet\n"); exit(2); ! } } --- 594,624 ---- break; + case 'C': + strcpy(command, optarg); + break; + + case 'u': + target_user = getpwnam(optarg); + if (target_user == NULL) + { + fprintf(stderr, "Unknown username '%s'\n", optarg); + exit(99); + } + target_uid = target_user->pw_uid; + target_gid = target_user->pw_gid; + break; + + case 'm': + max_connections = atoi(optarg); + break; case 'r': rating = atoi(optarg); break; ! default: fprintf(stderr, "No more service switches defined yet\n"); exit(2); ! } } *************** *** 612,616 **** } - char message[520]; int ptr = 2; --- 638,641 ---- *************** *** 619,622 **** --- 644,652 ---- add_string((unsigned char*)message, &ptr, (unsigned char*)name); add_string((unsigned char*)message, &ptr, (unsigned char*)ident); + message[ptr++] = max_connections; + *(uid_t *)(message+ptr) = target_uid; ptr += sizeof(uid_t); + *(gid_t *)(message+ptr) = target_gid; ptr += sizeof(gid_t); + add_string((unsigned char*)message, &ptr, (unsigned char*)command); + send_msg(latcp_socket, LATCP_ADDSERVICE, message, ptr); *************** *** 655,659 **** while ((opt=getopt(argc,argv,"a:p:")) != EOF) { ! switch(opt) { case 'a': --- 685,689 ---- while ((opt=getopt(argc,argv,"a:p:")) != EOF) { ! switch(opt) { case 'a': *************** *** 662,666 **** make_upper(name); break; ! case 'p': got_port = true; --- 692,696 ---- make_upper(name); break; ! case 'p': got_port = true; *************** *** 671,675 **** fprintf(stderr, "No more service switches defined yet\n"); exit(2); ! } } --- 701,705 ---- fprintf(stderr, "No more service switches defined yet\n"); exit(2); ! } } *************** *** 681,685 **** } ! if (!open_socket(false)) return; --- 711,715 ---- } ! if (!open_socket(false)) return; *************** *** 691,695 **** else send_msg(latcp_socket, LATCP_REMPORT, message, ptr); ! unsigned char *result; int len; --- 721,725 ---- else send_msg(latcp_socket, LATCP_REMPORT, message, ptr); ! unsigned char *result; int len; *************** *** 713,717 **** return; } ! // Look for latd in well-known places struct stat st; --- 743,747 ---- return; } ! // Look for latd in well-known places struct stat st; *************** *** 719,723 **** char *latd_path = NULL; ! if (!stat("/usr/sbin/latd", &st)) { latd_bin = "/usr/sbin/latd"; --- 749,771 ---- char *latd_path = NULL; ! // Look for latd in the same place as latcp ! char *name = (char *)malloc(strlen(argv[0])+1); ! char *path = (char *)malloc(strlen(argv[0])+1); ! strcpy(name, argv[0]); ! ! char *slash = rindex(name, '/'); ! if (slash) ! { ! *slash='\0'; ! strcpy(path, name); ! strcat(name, "/latd"); ! if (!stat(name, &st)) ! { ! latd_bin = name; ! latd_path = path; ! } ! } ! // Otherwise look in some well-known places ! else if (!stat("/usr/sbin/latd", &st)) { latd_bin = "/usr/sbin/latd"; *************** *** 729,751 **** latd_path = "/usr/local/sbin"; } - else - { - char *name = (char *)malloc(strlen(argv[0])+1); - char *path = (char *)malloc(strlen(argv[0])+1); - strcpy(name, argv[0]); - - char *slash = rindex(name, '/'); - if (slash) - { - *slash='\0'; - strcpy(path, name); - strcat(name, "/latd"); - if (!stat(name, &st)) - { - latd_bin = name; - latd_path = path; - } - } - } // Did we find it? --- 777,780 ---- *************** *** 759,763 **** char latcp_env[PATH_MAX+7]; ! // This is VERY Linux specific and need /proc mounted. // we get the full path of the current executable by doing a readlink. // /proc/<pid>/exe --- 788,792 ---- char latcp_env[PATH_MAX+7]; ! // This is VERY Linux specific and needs /proc mounted. // we get the full path of the current executable by doing a readlink. // /proc/<pid>/exe *************** *** 807,812 **** exit(2); } ! ! // Run startup script if there is one. if (!stat("/etc/latd.conf", &st)) --- 836,841 ---- exit(2); } ! ! // Run startup script if there is one. if (!stat("/etc/latd.conf", &st)) *************** *** 822,830 **** perror("exec of /bin/sh failed"); exit(0); ! case -1: perror("Fork failed"); exit(0); ! default: // Parent. Wait for child to finish waitpid(shell_pid, NULL, 0); --- 851,859 ---- perror("exec of /bin/sh failed"); exit(0); ! case -1: perror("Fork failed"); exit(0); ! default: // Parent. Wait for child to finish waitpid(shell_pid, NULL, 0); *************** *** 850,854 **** { unsigned char outhead[3]; ! outhead[0] = cmd; outhead[1] = len/256; --- 879,883 ---- { unsigned char outhead[3]; ! outhead[0] = cmd; outhead[1] = len/256; *************** *** 865,873 **** { unsigned char head[3]; ! // Get the message header (cmd & length) if (read(fd, head, sizeof(head)) != 3) return -1; // Bad header ! len = head[1] * 256 + head[2]; cmd = head[0]; --- 894,902 ---- { unsigned char head[3]; ! // Get the message header (cmd & length) if (read(fd, head, sizeof(head)) != 3) return -1; // Bad header ! len = head[1] * 256 + head[2]; cmd = head[0]; *************** *** 885,889 **** return -1; } ! return 0; } --- 914,918 ---- return -1; } ! return 0; } *************** *** 892,899 **** { struct sockaddr_un sockaddr; ! latcp_socket = socket(AF_UNIX, SOCK_STREAM, PF_UNIX); if (latcp_socket == -1) ! { if (!quiet) perror("Can't create socket"); return false; /* arggh ! */ --- 921,928 ---- { struct sockaddr_un sockaddr; ! latcp_socket = socket(AF_UNIX, SOCK_STREAM, PF_UNIX); if (latcp_socket == -1) ! { if (!quiet) perror("Can't create socket"); return false; /* arggh ! */ *************** *** 908,912 **** return false; } ! unsigned char *result; int len; --- 937,941 ---- return false; } ! unsigned char *result; int len; *************** *** 914,918 **** // Send our version ! send_msg(latcp_socket, LATCP_VERSION, VERSION, strlen(VERSION)+1); read_reply(latcp_socket, cmd, result, len); // Read version number back --- 943,947 ---- // Send our version ! send_msg(latcp_socket, LATCP_VERSION, VERSION, strlen(VERSION)+1); read_reply(latcp_socket, cmd, result, len); // Read version number back *************** *** 937,941 **** unsigned int intnum; unsigned int bitnum; ! intnum = entry / 8; bitnum = entry % 8; --- 966,970 ---- unsigned int intnum; unsigned int bitnum; ! intnum = entry / 8; bitnum = entry % 8; *************** *** 955,959 **** memset(bitmap, 0, 32); delimiter = strpbrk(cmdline, ",-"); ! do { --- 984,988 ---- memset(bitmap, 0, 32); delimiter = strpbrk(cmdline, ",-"); ! do { *************** *** 969,979 **** firstnum = atoi(cmdline); if (delimiter != NULL) delimiter[0] = delimchar; ! ! /* Found a comma -- mark the number preceding it as read */ if ((delimchar == ',') || (delimiter == NULL)) { set_in_bitmap(bitmap, firstnum); } ! /* Found a hyphen -- mark the range as read */ if (delimchar == '-') --- 998,1008 ---- firstnum = atoi(cmdline); if (delimiter != NULL) delimiter[0] = delimchar; ! ! /* Found a comma -- mark the number preceding it as read */ if ((delimchar == ',') || (delimiter == NULL)) { set_in_bitmap(bitmap, firstnum); } ! /* Found a hyphen -- mark the range as read */ if (delimchar == '-') *************** *** 989,993 **** secondnum = atoi(cmdline); if (delimiter != NULL) delimiter[0] = delimchar; ! for (i=firstnum; i<=secondnum; i++) { --- 1018,1022 ---- secondnum = atoi(cmdline); if (delimiter != NULL) delimiter[0] = delimchar; ! for (i=firstnum; i<=secondnum; i++) { *************** *** 996,1000 **** } if (delimiter == NULL) finished = true; ! cmdline = delimiter+1; if (delimiter != NULL) delimiter = strpbrk(cmdline, ",-"); --- 1025,1029 ---- } if (delimiter == NULL) finished = true; ! cmdline = delimiter+1; if (delimiter != NULL) delimiter = strpbrk(cmdline, ",-"); Index: latcpcircuit.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcpcircuit.cc,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** latcpcircuit.cc 2001/06/22 15:26:06 1.17 --- latcpcircuit.cc 2002/01/03 08:46:55 1.18 *************** *** 28,31 **** --- 28,32 ---- #include "services.h" #include "session.h" + #include "localport.h" #include "connection.h" #include "circuit.h" *************** *** 224,230 **** --- 225,235 ---- unsigned char name[255]; unsigned char ident[255]; + unsigned char command[1024]; bool static_rating; int rating; int ptr=2; + int max_connections; + uid_t target_uid; + gid_t target_gid; static_rating = (bool)cmdbuf[0]; *************** *** 232,240 **** get_string((unsigned char*)cmdbuf, &ptr, name); get_string((unsigned char*)cmdbuf, &ptr, ident); debuglog(("latcp: add service: %s (%s)\n", name, ident)); ! if (LATServer::Instance()->add_service((char*)name, (char*)ident, rating, static_rating)) send_reply(LATCP_ACK, "", -1); else --- 237,251 ---- get_string((unsigned char*)cmdbuf, &ptr, name); get_string((unsigned char*)cmdbuf, &ptr, ident); + max_connections = cmdbuf[ptr++]; + target_uid = *(uid_t *)(cmdbuf+ptr); ptr += sizeof(uid_t); + target_gid = *(gid_t *)(cmdbuf+ptr); ptr += sizeof(gid_t); + get_string((unsigned char*)cmdbuf, &ptr, command); debuglog(("latcp: add service: %s (%s)\n", name, ident)); ! if (LATServer::Instance()->add_service((char*)name, (char*)ident, (char*)command, ! max_connections, target_uid, target_gid, ! rating, static_rating)) send_reply(LATCP_ACK, "", -1); else *************** *** 338,347 **** service, remport, localport)); ! if (LATServer::Instance()->make_client_connection(service, ! remport, ! localport, ! remnode, ! queued, ! clean) < 0) { debuglog(("sending failure back to LATCP\n")); --- 349,358 ---- service, remport, localport)); ! if (LATServer::Instance()->create_local_port(service, ! remport, ! localport, ! remnode, ! queued, ! clean) < 0) { debuglog(("sending failure back to LATCP\n")); Index: llogin.1 =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogin.1,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** llogin.1 2001/03/27 10:50:26 1.5 --- llogin.1 2002/01/03 08:46:55 1.6 *************** *** 10,14 **** Options: .br ! [\-cpbhQ] [\-H node] [\-R port] [-n name] [\-q quit char] .SH DESCRIPTION .PP --- 10,14 ---- Options: .br ! [\-dvcpblhQ] [\-H node] [\-R port] [-n name] [\-q quit char] .SH DESCRIPTION .PP *************** *** 19,22 **** --- 19,28 ---- .SH OPTIONS .TP + .I "\-d" + Shows learned services. This is the same as latcp -d -l + .TP + .I "\-d \-v" + Verbose form of -d. -v without -d is ignored. + .TP .I "\-H <node>" Remote nodename. If the service is advertised by more than one node and you *************** *** 24,33 **** you will be connected to the node with the highest rating. .TP ! .I "\-R" Connect to a specific port on (usually) a terminal server. This is the port NAME on the server and not the port number. .TP .I "\-c" ! Do not convert LF to CR. By default the enter key generates LF and llogin converts it CR as it is the most generically useful translation. This switch will cause the enter key to send LF instead. Occasionally --- 30,39 ---- you will be connected to the node with the highest rating. .TP ! .I "\-R <port>" Connect to a specific port on (usually) a terminal server. This is the port NAME on the server and not the port number. .TP .I "\-c" ! Do not convert typed LF to CR. By default the enter key generates LF and llogin converts it CR as it is the most generically useful translation. This switch will cause the enter key to send LF instead. Occasionally *************** *** 35,43 **** .TP .I "\-b" ! Convert DEL to BS. By default the DEL key (keyboard, top right usually) send DEL (ASCII 0x7f) to the remote system. This switch will cause the DEL key to send BS (ASCII 8) instead. Useful for some Unix systems connected via terminal servers. .TP .I "\-q <char>" Change the quit character. By default CTRL-] will quit the terminal --- 41,54 ---- .TP .I "\-b" ! Convert typed DEL to BS. By default the DEL key (keyboard, top right usually) send DEL (ASCII 0x7f) to the remote system. This switch will cause the DEL key to send BS (ASCII 8) instead. Useful for some Unix systems connected via terminal servers. .TP + .I "\-l" + Convert output LF to VT. By default LF output is sent as CRLF which can + cause output formatting problems. Changing this to VT should preserve the + output formatting on most devices or terminal emulators. + .TP .I "\-q <char>" Change the quit character. By default CTRL-] will quit the terminal *************** *** 54,58 **** specify this switch when connecting to a queued service. .TP ! .I "\-n" Sets the local connection name. By default this will be your local TTY name. In most cases this simply affects the display of the terminal on the remote end --- 65,69 ---- specify this switch when connecting to a queued service. .TP ! .I "\-n <name>" Sets the local connection name. By default this will be your local TTY name. In most cases this simply affects the display of the terminal on the remote end *************** *** 66,70 **** to add them. This is just a convenient way to use the /dev/lat ports without the overhead of programs such as minicom. ! .SS SEE ALSO .BR latcp "(8), " latd "(8)" --- 77,84 ---- to add them. This is just a convenient way to use the /dev/lat ports without the overhead of programs such as minicom. ! .TP ! .I "\-h" ! Displays a brief usage description. This is the same as invoking llogin ! without any parameters at all. .SS SEE ALSO .BR latcp "(8), " latd "(8)" Index: llogin.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogin.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** llogin.cc 2001/03/27 10:48:49 1.9 --- llogin.cc 2002/01/03 08:46:55 1.10 *************** *** 60,65 **** static bool send_msg(int fd, int cmd, char *buf, int len); static bool open_socket(bool); ! static int terminal(int latfd, int, int, int); ! static int do_use_port(char *service, int quit_char, int crlf, int bsdel); static int usage(char *cmd) { --- 60,65 ---- static bool send_msg(int fd, int cmd, char *buf, int len); static bool open_socket(bool); ! static int terminal(int latfd, int, int, int, int); ! static int do_use_port(char *service, int quit_char, int crlf, int bsdel, int lfvt); static int usage(char *cmd) { *************** *** 67,76 **** printf (" where option is one of the following:\n"); printf (" -d show learned services\n"); printf (" -p connect to a local port rather than a service\n"); printf (" -H <node> remote node name\n"); printf (" -R <port> remote port name\n"); printf (" -Q connect to a queued service\n"); ! printf (" -c convert CR to LF\n"); ! printf (" -b convert DEL to BS\n"); printf (" -n <name> Local port name\n"); printf (" -q <char> quit character\n"); --- 67,79 ---- printf (" where option is one of the following:\n"); printf (" -d show learned services\n"); + printf (" -d -v show learned services verbosely\n"); printf (" -p connect to a local port rather than a service\n"); printf (" -H <node> remote node name\n"); printf (" -R <port> remote port name\n"); + printf (" -r <port> remote port name\n"); printf (" -Q connect to a queued service\n"); ! printf (" -c convert input CR to LF\n"); ! printf (" -b convert input DEL to BS\n"); ! printf (" -l convert output LF to VT\n"); printf (" -n <name> Local port name\n"); printf (" -q <char> quit character\n"); *************** *** 90,93 **** --- 93,97 ---- int crlf = 1; int bsdel = 0; + int lfvt = 0; int show_services = 0; int use_port = 0; *************** *** 98,109 **** { exit(usage(argv[0])); ! } // Set the default local port name if (ttyname(0)) strcpy(localport, ttyname(0)); ! while ((opt=getopt(argc,argv,"dpcvhbQH:R:q:n:")) != EOF) { ! switch(opt) { case 'd': --- 102,113 ---- { exit(usage(argv[0])); ! } // Set the default local port name if (ttyname(0)) strcpy(localport, ttyname(0)); ! while ((opt=getopt(argc,argv,"dpcvhlbQH:R:r:q:n:")) != EOF) { ! switch(opt) { case 'd': *************** *** 119,122 **** --- 123,130 ---- break; + case 'l': + lfvt = 1; + break; + case 'p': use_port = 1; *************** *** 143,146 **** --- 151,155 ---- case 'R': + case 'r': strcpy(port, optarg); break; *************** *** 169,173 **** if (use_port) { ! do_use_port(service, quit_char, crlf, bsdel); return 0; } --- 178,182 ---- if (use_port) { ! do_use_port(service, quit_char, crlf, bsdel, lfvt); return 0; } *************** *** 183,197 **** // This is the same as latcp -d -l send_msg(latcp_socket, LATCP_SHOWSERVICE, verboseflag, 1); ! unsigned char *result; int len; int cmd; read_reply(latcp_socket, cmd, result, len); ! cout << result; ! ! delete[] result; return 0; ! } make_upper(node); --- 192,206 ---- // This is the same as latcp -d -l send_msg(latcp_socket, LATCP_SHOWSERVICE, verboseflag, 1); ! unsigned char *result; int len; int cmd; read_reply(latcp_socket, cmd, result, len); ! cout << result; ! ! delete[] result; return 0; ! } make_upper(node); *************** *** 217,221 **** // If the reply was good then go into terminal mode. ! terminal(latcp_socket, quit_char, crlf, bsdel); shutdown(latcp_socket, 3); --- 226,230 ---- // If the reply was good then go into terminal mode. ! terminal(latcp_socket, quit_char, crlf, bsdel, lfvt); shutdown(latcp_socket, 3); *************** *** 229,237 **** { unsigned char head[3]; ! // Get the message header (cmd & length) if (read(fd, head, sizeof(head)) != 3) return -1; // Bad header ! len = head[1] * 256 + head[2]; cmd = head[0]; --- 238,246 ---- { unsigned char head[3]; ! // Get the message header (cmd & length) if (read(fd, head, sizeof(head)) != 3) return -1; // Bad header ! len = head[1] * 256 + head[2]; cmd = head[0]; *************** *** 249,253 **** return -1; } ! return 0; } --- 258,262 ---- return -1; } ! return 0; } *************** *** 256,263 **** { struct sockaddr_un sockaddr; ! latcp_socket = socket(AF_UNIX, SOCK_STREAM, PF_UNIX); if (latcp_socket == -1) ! { if (!quiet) perror("Can't create socket"); return false; /* arggh ! */ --- 265,272 ---- { struct sockaddr_un sockaddr; ! latcp_socket = socket(AF_UNIX, SOCK_STREAM, PF_UNIX); if (latcp_socket == -1) ! { if (!quiet) perror("Can't create socket"); return false; /* arggh ! */ *************** *** 272,276 **** return false; } ! unsigned char *result; int len; --- 281,285 ---- return false; } ! unsigned char *result; int len; *************** *** 278,282 **** // Send our version ! send_msg(latcp_socket, LATCP_VERSION, VERSION, strlen(VERSION)+1); read_reply(latcp_socket, cmd, result, len); // Read version number back --- 287,291 ---- // Send our version ! send_msg(latcp_socket, LATCP_VERSION, VERSION, strlen(VERSION)+1); read_reply(latcp_socket, cmd, result, len); // Read version number back *************** *** 298,302 **** { unsigned char outhead[3]; ! outhead[0] = cmd; outhead[1] = len/256; --- 307,311 ---- { unsigned char outhead[3]; ! outhead[0] = cmd; outhead[1] = len/256; *************** *** 309,313 **** // Pretend to be a terminal connected to a LAT service ! static int terminal(int latfd, int endchar, int crlf, int bsdel) { int termfd = STDIN_FILENO; --- 318,322 ---- // Pretend to be a terminal connected to a LAT service ! static int terminal(int latfd, int endchar, int crlf, int bsdel, int lfvt) { int termfd = STDIN_FILENO; *************** *** 356,368 **** if (endchar >0 && inbuf[i] == endchar) goto quit; ! if (inbuf[i] == '\n' && crlf) inbuf[i] = '\r'; ! if (inbuf[i] == '\177' && bsdel) inbuf[i] = '\010'; } write(latfd, inbuf, len); - } --- 365,376 ---- if (endchar >0 && inbuf[i] == endchar) goto quit; ! if (inbuf[i] == '\n' && crlf) inbuf[i] = '\r'; ! if (inbuf[i] == '\177' && bsdel) inbuf[i] = '\010'; } write(latfd, inbuf, len); } *************** *** 374,381 **** break; else write(termfd, inbuf, len); } } ! quit: // Reset terminal attributes tcsetattr(termfd, TCSANOW, &old_term); --- 382,397 ---- break; else + { + if (lfvt) + { + for (int i=0; i<len; i++) + if (inbuf[i] == '\n') + inbuf[i] = '\v'; + } write(termfd, inbuf, len); + } } } ! quit: // Reset terminal attributes tcsetattr(termfd, TCSANOW, &old_term); *************** *** 385,389 **** } ! static int do_use_port(char *portname, int quit_char, int crlf, int bsdel) { int termfd; --- 401,405 ---- } ! static int do_use_port(char *portname, int quit_char, int crlf, int bsdel, int lfvt) { int termfd; *************** *** 401,408 **** new_term = old_term; ! // Set local terminal characteristics ! new_term.c_iflag &= ~BRKINT; new_term.c_iflag |= IGNBRK; new_term.c_lflag &= ~ISIG; new_term.c_cc[VMIN] = 1; new_term.c_cc[VTIME] = 0; --- 417,425 ---- new_term = old_term; ! // Set local terminal characteristics ! new_term.c_iflag &= ~(BRKINT | ICRNL); new_term.c_iflag |= IGNBRK; new_term.c_lflag &= ~ISIG; + new_term.c_oflag &= ~OCRNL; new_term.c_cc[VMIN] = 1; ... [truncated message content] |
From: Patrick C. <pa...@us...> - 2002-01-03 08:46:59
|
Update of /cvsroot/linux-decnet/latd/debian In directory usw-pr-cvs1:/tmp/cvs-serv31180/debian Modified Files: changelog control Log Message: Move files from 1.10 branch to the head where they belong. The 1.0 version is now on TAG_LATD_BRANCH_1_0. Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/latd/debian/changelog,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** changelog 2002/01/03 08:36:33 1.2 --- changelog 2002/01/03 08:46:56 1.3 *************** *** 1,2 **** --- 1,28 ---- + latd (1.12-1) unstable; urgency=low + + * llogin -r is an alias for llogin -R (easier to type!) + * New moprc program for remote administration of terminal servers + + -- + + latd (1.11-1) unstable; urgency=low + + * Added -l switch to llogin to replace LF with VT + * Document -d -v switch to llogin + * Renamed PortSession to QueuedSession so it's less confusing + * /dev/lat ports connect using LocalPort and localportSession so they + can share connections. + * Fixed spurious newlines generated by llogin -p + + -- Patrick Caulfield <pa...@de...> Wed, 26 Sep 2001 14:37:43 +0100 + + latd (1.10-1) unstable; urgency=low + + * Can now handle multiple reverse-LAT connections via the same connection + (llogin only) + * Can specify a command to run (and user to run it under) for a named service. + + -- Patrick Caulfield <pa...@de...> Thu, 16 Aug 2001 11:54:28 +0100 + latd (1.03-1) unstable; urgency=low Index: control =================================================================== RCS file: /cvsroot/linux-decnet/latd/debian/control,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** control 2002/01/03 08:36:33 1.5 --- control 2002/01/03 08:46:56 1.6 *************** *** 17,19 **** . There is also an llogin utility that allows users to login to remote ! LAT services. --- 17,19 ---- . There is also an llogin utility that allows users to login to remote ! LAT services and a moprc utility for managing terminal servers remotely. |
From: Patrick C. <pa...@us...> - 2002-01-03 08:42:04
|
Update of /cvsroot/linux-decnet/latd/debian In directory usw-pr-cvs1:/tmp/cvs-serv30411/debian Modified Files: Tag: TAG_BRANCH_1_10 changelog control Log Message: Sync some minor changes (mostly the removal of trailing spaces) Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/latd/debian/changelog,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -r1.1.2.1 -r1.1.2.2 *** changelog 2001/09/26 13:38:38 1.1.2.1 --- changelog 2002/01/03 08:42:00 1.1.2.2 *************** *** 1,2 **** --- 1,9 ---- + latd (1.12-1) unstable; urgency=low + + * llogin -r is an alias for llogin -R (easier to type!) + * New moprc program for remote administration of terminal servers + + -- + latd (1.11-1) unstable; urgency=low Index: control =================================================================== RCS file: /cvsroot/linux-decnet/latd/debian/control,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -r1.3.2.1 -r1.3.2.2 *** control 2001/09/11 13:18:36 1.3.2.1 --- control 2002/01/03 08:42:00 1.3.2.2 *************** *** 17,19 **** . There is also an llogin utility that allows users to login to remote ! LAT services. --- 17,19 ---- . There is also an llogin utility that allows users to login to remote ! LAT services and a moprc utility for managing terminal servers remotely. |
From: Patrick C. <pa...@us...> - 2002-01-03 08:42:03
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv30411 Modified Files: Tag: TAG_BRANCH_1_10 connection.cc latcp.cc Log Message: Sync some minor changes (mostly the removal of trailing spaces) Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.31.2.11 retrieving revision 1.31.2.12 diff -C2 -r1.31.2.11 -r1.31.2.12 *** connection.cc 2001/11/08 19:13:47 1.31.2.11 --- connection.cc 2002/01/03 08:42:00 1.31.2.12 *************** *** 414,420 **** } - // See if there is any data we can send in this reply - add_data_slots(num_replies, reply); - // If "Response Requested" set, then make sure we send one. if (msg->header.cmd & 1 && !replyhere) --- 414,417 ---- *************** *** 423,429 **** replyhere = true; } - last_ack_number = last_message_acked; // Send any replies if (replyhere || num_replies) { --- 420,431 ---- replyhere = true; } + // See if there is any data we can send in this reply + // This doesn't work if we are a server for some reason I don't understand + // if (role == CLIENT) + //num_replies = add_data_slots(num_replies, reply); + // Send any replies + last_ack_number = last_message_acked; if (replyhere || num_replies) { *************** *** 490,496 **** if (type == DATA) { - last_sequence_number++; retransmit_count = 0; - last_sent_sequence = last_sequence_number; window_size++; debuglog(("send_message, window_size now %d\n", window_size)); --- 492,496 ---- *************** *** 500,508 **** if (type == REPLY) { - last_sequence_number++; - last_sent_sequence = last_sequence_number; need_ack = false; } response->local_connid = num; response->remote_connid = remote_connid; --- 500,509 ---- if (type == REPLY) { need_ack = false; } + last_sequence_number++; + last_sent_sequence = last_sequence_number; + response->local_connid = num; response->remote_connid = remote_connid; *************** *** 766,772 **** } ! while (slot_num < max_slots_per_packet && !slots_pending.empty()) { slot_cmd &cmd(slots_pending.front()); --- 767,781 ---- } ! // Overwrite any empty slot at the start ! LAT_SlotCmd *slot_header = (LAT_SlotCmd *)slots[0]; ! if (start_slot == 1 && ! slot_header->length == 0 && ! !slots_pending.empty()) { + slot_num--; + } + while (slot_num < max_slots_per_packet && !slots_pending.empty()) + { slot_cmd &cmd(slots_pending.front()); Index: latcp.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcp.cc,v retrieving revision 1.26.2.3 retrieving revision 1.26.2.4 diff -C2 -r1.26.2.3 -r1.26.2.4 *** latcp.cc 2001/07/04 08:36:00 1.26.2.3 --- latcp.cc 2002/01/03 08:42:00 1.26.2.4 *************** *** 119,123 **** // Parse the command. // because the args vary so much for each command I just check argv[1] ! // for the command switch and the command processors call getopt themselves if (argc == 1) --- 119,123 ---- // Parse the command. // because the args vary so much for each command I just check argv[1] ! // for the command switch and the command processors call getopt themselves if (argc == 1) *************** *** 202,206 **** exit(usage(argv[0])); break; ! } } --- 202,206 ---- exit(usage(argv[0])); break; ! } } *************** *** 208,221 **** // Display latd characteristics or learned services void display(int argc, char *argv[]) ! { char verboseflag[1] = {'\0'}; signed char opt; bool show_services = false; ! if (!open_socket(false)) return; while ((opt=getopt(argc,argv,"lv")) != EOF) { ! switch(opt) { case 'l': --- 208,221 ---- // Display latd characteristics or learned services void display(int argc, char *argv[]) ! { char verboseflag[1] = {'\0'}; signed char opt; bool show_services = false; ! if (!open_socket(false)) return; while ((opt=getopt(argc,argv,"lv")) != EOF) { ! switch(opt) { case 'l': *************** *** 250,254 **** cout << result; ! delete[] result; } --- 250,254 ---- cout << result; ! delete[] result; } *************** *** 261,270 **** char service[256]; signed char opt; ! if (!open_socket(false)) return; while ((opt=getopt(argc,argv,"x:sa:")) != EOF) { ! switch(opt) { case 'x': --- 261,270 ---- char service[256]; signed char opt; ! if (!open_socket(false)) return; while ((opt=getopt(argc,argv,"x:sa:")) != EOF) { ! switch(opt) { case 'x': *************** *** 294,298 **** make_upper(service); ! char message[520]; int ptr = 2; --- 294,298 ---- make_upper(service); ! char message[520]; int ptr = 2; *************** *** 308,312 **** exit (read_reply(latcp_socket, cmd, result, len)); ! } --- 308,312 ---- exit (read_reply(latcp_socket, cmd, result, len)); ! } *************** *** 318,327 **** char ident[256]; signed char opt; ! if (!open_socket(false)) return; while ((opt=getopt(argc,argv,"i:a:")) != EOF) { ! switch(opt) { case 'a': --- 318,327 ---- char ident[256]; signed char opt; ! if (!open_socket(false)) return; while ((opt=getopt(argc,argv,"i:a:")) != EOF) { ! switch(opt) { case 'a': *************** *** 340,344 **** make_upper(service); ! char message[1024]; int ptr = 0; --- 340,344 ---- make_upper(service); ! char message[1024]; int ptr = 0; *************** *** 360,367 **** int cmd; char groups[256]; ! while ((opt=getopt(argc,argv,"G:g:")) != EOF) { ! switch(opt) { case 'G': --- 360,367 ---- int cmd; char groups[256]; ! while ((opt=getopt(argc,argv,"G:g:")) != EOF) { ! switch(opt) { case 'G': *************** *** 385,389 **** char bitmap[32]; // 256 bits make_bitmap(bitmap, groups); ! send_msg(latcp_socket, cmd, bitmap, 32); --- 385,389 ---- char bitmap[32]; // 256 bits make_bitmap(bitmap, groups); ! send_msg(latcp_socket, cmd, bitmap, 32); *************** *** 400,407 **** int cmd; char groups[256]; ! while ((opt=getopt(argc,argv,"u:U:")) != EOF) { ! switch(opt) { case 'U': --- 400,407 ---- int cmd; char groups[256]; ! while ((opt=getopt(argc,argv,"u:U:")) != EOF) { ! switch(opt) { case 'U': *************** *** 425,429 **** char bitmap[32]; // 256 bits make_bitmap(bitmap, groups); ! send_msg(latcp_socket, cmd, bitmap, 32); --- 425,429 ---- char bitmap[32]; // 256 bits make_bitmap(bitmap, groups); ! send_msg(latcp_socket, cmd, bitmap, 32); *************** *** 442,446 **** char flag[1]; flag[0] = onoff; ! send_msg(latcp_socket, LATCP_SETRESPONDER, flag, 1); } --- 442,446 ---- char flag[1]; flag[0] = onoff; ! send_msg(latcp_socket, LATCP_SETRESPONDER, flag, 1); } *************** *** 504,512 **** make_upper(name); ! char message[520]; int ptr = 0; add_string((unsigned char*)message, &ptr, (unsigned char*)name); ! send_msg(latcp_socket, LATCP_SETNODENAME, message, ptr); return; --- 504,512 ---- make_upper(name); ! char message[520]; int ptr = 0; add_string((unsigned char*)message, &ptr, (unsigned char*)name); ! send_msg(latcp_socket, LATCP_SETNODENAME, message, ptr); return; *************** *** 533,538 **** gid_t target_gid = 0; struct passwd *target_user; ! ! opterr = 0; optind = 0; --- 533,538 ---- gid_t target_gid = 0; struct passwd *target_user; ! ! opterr = 0; optind = 0; *************** *** 540,544 **** while ((opt=getopt(argc,argv,"a:i:p:H:R:V:r:sQ8C:m:u:")) != EOF) { ! switch(opt) { case 'a': --- 540,544 ---- while ((opt=getopt(argc,argv,"a:i:p:H:R:V:r:sQ8C:m:u:")) != EOF) { ! switch(opt) { case 'a': *************** *** 616,624 **** rating = atoi(optarg); break; ! default: fprintf(stderr, "No more service switches defined yet\n"); exit(2); ! } } --- 616,624 ---- rating = atoi(optarg); break; ! default: fprintf(stderr, "No more service switches defined yet\n"); exit(2); ! } } *************** *** 637,641 **** exit(2); } ! char message[520]; int ptr = 2; --- 637,641 ---- exit(2); } ! char message[520]; int ptr = 2; *************** *** 685,689 **** while ((opt=getopt(argc,argv,"a:p:")) != EOF) { ! switch(opt) { case 'a': --- 685,689 ---- while ((opt=getopt(argc,argv,"a:p:")) != EOF) { ! switch(opt) { case 'a': *************** *** 692,696 **** make_upper(name); break; ! case 'p': got_port = true; --- 692,696 ---- make_upper(name); break; ! case 'p': got_port = true; *************** *** 701,705 **** fprintf(stderr, "No more service switches defined yet\n"); exit(2); ! } } --- 701,705 ---- fprintf(stderr, "No more service switches defined yet\n"); exit(2); ! } } *************** *** 711,715 **** } ! if (!open_socket(false)) return; --- 711,715 ---- } ! if (!open_socket(false)) return; *************** *** 721,725 **** else send_msg(latcp_socket, LATCP_REMPORT, message, ptr); ! unsigned char *result; int len; --- 721,725 ---- else send_msg(latcp_socket, LATCP_REMPORT, message, ptr); ! unsigned char *result; int len; *************** *** 743,747 **** return; } ! // Look for latd in well-known places struct stat st; --- 743,747 ---- return; } ! // Look for latd in well-known places struct stat st; *************** *** 753,757 **** char *path = (char *)malloc(strlen(argv[0])+1); strcpy(name, argv[0]); ! char *slash = rindex(name, '/'); if (slash) --- 753,757 ---- char *path = (char *)malloc(strlen(argv[0])+1); strcpy(name, argv[0]); ! char *slash = rindex(name, '/'); if (slash) *************** *** 788,792 **** char latcp_env[PATH_MAX+7]; ! // This is VERY Linux specific and needs /proc mounted. // we get the full path of the current executable by doing a readlink. // /proc/<pid>/exe --- 788,792 ---- char latcp_env[PATH_MAX+7]; ! // This is VERY Linux specific and needs /proc mounted. // we get the full path of the current executable by doing a readlink. // /proc/<pid>/exe *************** *** 836,841 **** exit(2); } ! ! // Run startup script if there is one. if (!stat("/etc/latd.conf", &st)) --- 836,841 ---- exit(2); } ! ! // Run startup script if there is one. if (!stat("/etc/latd.conf", &st)) *************** *** 851,859 **** perror("exec of /bin/sh failed"); exit(0); ! case -1: perror("Fork failed"); exit(0); ! default: // Parent. Wait for child to finish waitpid(shell_pid, NULL, 0); --- 851,859 ---- perror("exec of /bin/sh failed"); exit(0); ! case -1: perror("Fork failed"); exit(0); ! default: // Parent. Wait for child to finish waitpid(shell_pid, NULL, 0); *************** *** 879,883 **** { unsigned char outhead[3]; ! outhead[0] = cmd; outhead[1] = len/256; --- 879,883 ---- { unsigned char outhead[3]; ! outhead[0] = cmd; outhead[1] = len/256; *************** *** 894,902 **** { unsigned char head[3]; ! // Get the message header (cmd & length) if (read(fd, head, sizeof(head)) != 3) return -1; // Bad header ! len = head[1] * 256 + head[2]; cmd = head[0]; --- 894,902 ---- { unsigned char head[3]; ! // Get the message header (cmd & length) if (read(fd, head, sizeof(head)) != 3) return -1; // Bad header ! len = head[1] * 256 + head[2]; cmd = head[0]; *************** *** 914,918 **** return -1; } ! return 0; } --- 914,918 ---- return -1; } ! return 0; } *************** *** 921,928 **** { struct sockaddr_un sockaddr; ! latcp_socket = socket(AF_UNIX, SOCK_STREAM, PF_UNIX); if (latcp_socket == -1) ! { if (!quiet) perror("Can't create socket"); return false; /* arggh ! */ --- 921,928 ---- { struct sockaddr_un sockaddr; ! latcp_socket = socket(AF_UNIX, SOCK_STREAM, PF_UNIX); if (latcp_socket == -1) ! { if (!quiet) perror("Can't create socket"); return false; /* arggh ! */ *************** *** 937,941 **** return false; } ! unsigned char *result; int len; --- 937,941 ---- return false; } ! unsigned char *result; int len; *************** *** 943,947 **** // Send our version ! send_msg(latcp_socket, LATCP_VERSION, VERSION, strlen(VERSION)+1); read_reply(latcp_socket, cmd, result, len); // Read version number back --- 943,947 ---- // Send our version ! send_msg(latcp_socket, LATCP_VERSION, VERSION, strlen(VERSION)+1); read_reply(latcp_socket, cmd, result, len); // Read version number back *************** *** 966,970 **** unsigned int intnum; unsigned int bitnum; ! intnum = entry / 8; bitnum = entry % 8; --- 966,970 ---- unsigned int intnum; unsigned int bitnum; ! intnum = entry / 8; bitnum = entry % 8; *************** *** 984,988 **** memset(bitmap, 0, 32); delimiter = strpbrk(cmdline, ",-"); ! do { --- 984,988 ---- memset(bitmap, 0, 32); delimiter = strpbrk(cmdline, ",-"); ! do { *************** *** 998,1008 **** firstnum = atoi(cmdline); if (delimiter != NULL) delimiter[0] = delimchar; ! ! /* Found a comma -- mark the number preceding it as read */ if ((delimchar == ',') || (delimiter == NULL)) { set_in_bitmap(bitmap, firstnum); } ! /* Found a hyphen -- mark the range as read */ if (delimchar == '-') --- 998,1008 ---- firstnum = atoi(cmdline); if (delimiter != NULL) delimiter[0] = delimchar; ! ! /* Found a comma -- mark the number preceding it as read */ if ((delimchar == ',') || (delimiter == NULL)) { set_in_bitmap(bitmap, firstnum); } ! /* Found a hyphen -- mark the range as read */ if (delimchar == '-') *************** *** 1018,1022 **** secondnum = atoi(cmdline); if (delimiter != NULL) delimiter[0] = delimchar; ! for (i=firstnum; i<=secondnum; i++) { --- 1018,1022 ---- secondnum = atoi(cmdline); if (delimiter != NULL) delimiter[0] = delimchar; ! for (i=firstnum; i<=secondnum; i++) { *************** *** 1025,1029 **** } if (delimiter == NULL) finished = true; ! cmdline = delimiter+1; if (delimiter != NULL) delimiter = strpbrk(cmdline, ",-"); --- 1025,1029 ---- } if (delimiter == NULL) finished = true; ! cmdline = delimiter+1; if (delimiter != NULL) delimiter = strpbrk(cmdline, ",-"); |
From: Patrick C. <pa...@us...> - 2002-01-03 08:36:36
|
Update of /cvsroot/linux-decnet/latd/debian In directory usw-pr-cvs1:/tmp/cvs-serv29564/debian Modified Files: changelog control Log Message: Sync changes that have been sat there for a bit. Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/latd/debian/changelog,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** changelog 2001/07/17 08:06:25 1.1 --- changelog 2002/01/03 08:36:33 1.2 *************** *** 2,6 **** * Use std:: namespace so it compiles with GCC 3.0 ! * Don't depend on libstdc++2.10-dev. Closes: bug#104954 -- Patrick Caulfield <pa...@de...> Sun, 15 Jul 2001 19:44:36 +0100 --- 2,9 ---- * Use std:: namespace so it compiles with GCC 3.0 ! * Don't use makedepend for dependancy management. ! * Don't depend on libstdc++2.10-dev. ! Closes: bug#104954 ! * Fix includes in server.cc that depend for GLIBC version -- Patrick Caulfield <pa...@de...> Sun, 15 Jul 2001 19:44:36 +0100 Index: control =================================================================== RCS file: /cvsroot/linux-decnet/latd/debian/control,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** control 2001/07/16 10:01:29 1.4 --- control 2002/01/03 08:36:33 1.5 *************** *** 3,7 **** Priority: extra Maintainer: Patrick Caulfield <pa...@de...> ! Build-Depends: fakeroot, debhelper(>=2.0) Standards-Version: 3.5.0 --- 3,7 ---- Priority: extra Maintainer: Patrick Caulfield <pa...@de...> ! Build-Depends: debhelper(>=2.0) Standards-Version: 3.5.0 |
From: Patrick C. <pa...@us...> - 2002-01-03 08:36:36
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv29564 Modified Files: Makefile NEWS Log Message: Sync changes that have been sat there for a bit. Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/latd/Makefile,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** Makefile 2001/07/17 08:00:47 1.24 --- Makefile 2002/01/03 08:36:33 1.25 *************** *** 1,5 **** # Makefile for LAT server ! VERSION=1.03 PKGNAME=latd --- 1,5 ---- # Makefile for LAT server ! VERSION=1.04 PKGNAME=latd *************** *** 28,32 **** --- 28,36 ---- CXXFLAGS+=$(OPTDEBUG) $(DEFS) -pipe -Wstrict-prototypes -Wall -fno-rtti -fno-exceptions + # ARCH code taken from the Linux kernel sources. # + ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) + + # # For DEB builds # *************** *** 108,112 **** install README NEWS BUILD mkdir -p RPMS ! rpm -bb --buildroot `pwd`/rpmbuild --rcfile .rpmrc -v $(PKGNAME).spec rm -f $(PKGNAME).spec .rpmrc .rpmmacros --- 112,116 ---- install README NEWS BUILD mkdir -p RPMS ! rpm -bb --target=$(ARCH) --buildroot `pwd`/rpmbuild --rcfile .rpmrc -v $(PKGNAME).spec rm -f $(PKGNAME).spec .rpmrc .rpmmacros Index: NEWS =================================================================== RCS file: /cvsroot/linux-decnet/latd/NEWS,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** NEWS 2001/03/03 15:39:35 1.20 --- NEWS 2002/01/03 08:36:33 1.21 *************** *** 1,3 **** ! latd (1.02-1potato) unstable; urgency=low * Fixed bug where you *had* to specify a node name in reverse connections --- 1,13 ---- ! latd (1.03-1) unstable; urgency=low ! ! * Use std:: namespace so it compiles with GCC 3.0 ! * Don't use makedepend for dependancy management. ! * Don't depend on libstdc++2.10-dev. ! Closes: bug#104954 ! * Fix includes in server.cc that depend for GLIBC version ! ! -- Patrick Caulfield <pa...@de...> Sun, 15 Jul 2001 19:44:36 +0100 ! ! latd (1.02-1) unstable; urgency=low * Fixed bug where you *had* to specify a node name in reverse connections |
From: Patrick C. <pa...@us...> - 2001-12-10 12:01:38
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory usw-pr-cvs1:/tmp/cvs-serv2118/debian Modified Files: changelog Log Message: Changelog for 2.18 Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/changelog,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** changelog 2001/11/09 14:37:57 1.17 --- changelog 2001/12/10 12:01:35 1.18 *************** *** 1,2 **** --- 1,11 ---- + dnprogs (2.18-1) unstable; urgency=low + + * Fix dependancies in dnet-progs so libdnet gets pulled in too even when + build by the autobuilders. Closes: bug#122893 + * Fix sending of binary files by FAL by block. + * Add .html, .tgz & .bz2 file types to FAL types list + + -- Patrick Caulfield <pa...@de...> Mon, 10 Dec 2001 10:15:12 +0000 + dnprogs (2.17-1) unstable; urgency=low |
From: Patrick C. <pa...@us...> - 2001-12-09 16:30:15
|
Update of /cvsroot/linux-decnet/dnprogs/fal In directory usw-pr-cvs1:/tmp/cvs-serv20108 Modified Files: task.cc Log Message: .tgz only needs to be in there once! Index: task.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/task.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** task.cc 2001/12/09 16:26:24 1.6 --- task.cc 2001/12/09 16:30:12 1.7 *************** *** 1092,1095 **** .tgz b 512\n\ .bz2 b 512\n\ - .tgz b 512\n\ # End of file\n"; --- 1092,1094 ---- |
From: Patrick C. <pa...@us...> - 2001-12-09 16:26:26
|
Update of /cvsroot/linux-decnet/dnprogs/fal In directory usw-pr-cvs1:/tmp/cvs-serv19388 Modified Files: task.cc fal.8 Log Message: Add some more file types Index: task.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/task.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** task.cc 2001/12/08 12:21:06 1.5 --- task.cc 2001/12/09 16:26:24 1.6 *************** *** 1080,1083 **** --- 1080,1084 ---- .cc r\n\ .log r\n\ + .html r\n\ # VMS types\n\ .com r\n\ *************** *** 1089,1091 **** --- 1090,1095 ---- .tar b 10240\n\ .gz b 512\n\ + .tgz b 512\n\ + .bz2 b 512\n\ + .tgz b 512\n\ # End of file\n"; Index: fal.8 =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/fal.8,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** fal.8 2001/09/13 13:48:19 1.4 --- fal.8 2001/12/09 16:26:24 1.5 *************** *** 92,95 **** --- 92,96 ---- .cc r .log r + .html r # VMS types .com r *************** *** 101,104 **** --- 102,107 ---- .tar b 10240 .gz b 512 + .tgz b 512 + .bz2 b 512 # End of file .fi |