linux-decnet-commit Mailing List for DECnet for Linux (Page 39)
Brought to you by:
chrissie_c,
ph3-der-loewe
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(20) |
Feb
(27) |
Mar
(25) |
Apr
(12) |
May
(2) |
Jun
(6) |
Jul
(36) |
Aug
(12) |
Sep
(12) |
Oct
(16) |
Nov
(5) |
Dec
(5) |
2003 |
Jan
(8) |
Feb
(9) |
Mar
(25) |
Apr
(18) |
May
(29) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
(10) |
Oct
(5) |
Nov
(3) |
Dec
(9) |
2004 |
Jan
(17) |
Feb
|
Mar
(9) |
Apr
|
May
(4) |
Jun
(1) |
Jul
(2) |
Aug
(21) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2005 |
Jan
(5) |
Feb
|
Mar
(13) |
Apr
|
May
(3) |
Jun
(1) |
Jul
|
Aug
|
Sep
(13) |
Oct
(83) |
Nov
(2) |
Dec
|
2006 |
Jan
(21) |
Feb
(1) |
Mar
(32) |
Apr
(31) |
May
(3) |
Jun
(1) |
Jul
|
Aug
(7) |
Sep
|
Oct
(1) |
Nov
(3) |
Dec
(13) |
2007 |
Jan
(1) |
Feb
(7) |
Mar
|
Apr
(2) |
May
|
Jun
(1) |
Jul
(2) |
Aug
(20) |
Sep
|
Oct
|
Nov
|
Dec
(7) |
2008 |
Jan
(4) |
Feb
(13) |
Mar
(24) |
Apr
(18) |
May
(10) |
Jun
|
Jul
|
Aug
(40) |
Sep
(72) |
Oct
(61) |
Nov
(9) |
Dec
(2) |
2009 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
(8) |
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
(41) |
Aug
(28) |
Sep
(2) |
Oct
(5) |
Nov
(4) |
Dec
|
2011 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Patrick C. <pa...@us...> - 2002-02-28 17:52:48
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv11749 Modified Files: connection.cc connection.h Log Message: Completely rewritten SEQ/ACK logic so it's readable and also works reliably - even on bad networks. Not quite finished yet but quite near. Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -r1.40 -r1.41 *** connection.cc 16 Feb 2002 16:27:47 -0000 1.40 --- connection.cc 28 Feb 2002 17:52:43 -0000 1.41 *************** *** 51,56 **** interface(_interface), keepalive_timer(0), ! last_sequence_number(_ack), ! last_ack_number(_seq), last_time(0L), queued_slave(false), --- 51,58 ---- interface(_interface), keepalive_timer(0), ! last_sent_seq(0xff), ! last_sent_ack(0), ! last_recv_seq(_seq), ! last_recv_ack(_ack), last_time(0L), queued_slave(false), *************** *** 63,68 **** LAT_Start *msg = (LAT_Start *)buf; ! debuglog(("New connection: (c: %x, s: %x)\n", ! last_sequence_number, last_ack_number)); get_string(buf, &ptr, servicename); // This is actually local nodename --- 65,70 ---- LAT_Start *msg = (LAT_Start *)buf; ! debuglog(("New connection: (s: %x, a: %x)\n", ! last_recv_seq, last_recv_ack)); get_string(buf, &ptr, servicename); // This is actually local nodename *************** *** 76,80 **** highest_session = 1; max_window_size = msg->exqueued+1; ! max_window_size = 1; // All we can manage window_size = 0; lat_eco = msg->latver_eco; --- 78,82 ---- highest_session = 1; max_window_size = msg->exqueued+1; ! max_window_size = 1; // PJC All we can manage window_size = 0; lat_eco = msg->latver_eco; *************** *** 96,101 **** num(_num), keepalive_timer(0), ! last_sequence_number(0xff), ! last_ack_number(0xff), last_time(0L), queued(queued), --- 98,105 ---- num(_num), keepalive_timer(0), ! last_sent_seq(0xff), ! last_sent_ack(0), ! last_recv_seq(0), ! last_recv_ack(0xff), last_time(0L), queued(queued), *************** *** 113,119 **** strcpy(lta_name, _lta); ! max_slots_per_packet = 4; // TODO: Calculate // PJC Test max_window_size = 1; // Gets overridden later on. ! window_size = 0 ; next_session = 1; highest_session = 1; --- 117,123 ---- strcpy(lta_name, _lta); ! max_slots_per_packet = 4; max_window_size = 1; // Gets overridden later on. ! window_size = 0; next_session = 1; highest_session = 1; *************** *** 142,171 **** reply[ri] = (LAT_SlotCmd *)replybuf[ri]; - window_size--; - if (window_size < 0) window_size=0; - - // For duplicate checking - unsigned char saved_last_sequence_number = last_sequence_number; - unsigned char saved_last_message_acked = last_message_acked; - - last_sequence_number = msg->header.ack_number; - last_message_acked = msg->header.sequence_number; - #ifdef REALLY_VERBOSE_DEBUGLOG ! debuglog(("MSG: seq: %d, ack: %d\n", ! msg->header.sequence_number, msg->header.ack_number)); debuglog(("PREV:last seq: %d, last ack: %d\n", ! last_sent_sequence, last_ack_number)); #endif // Is this a duplicate? ! if (saved_last_sequence_number == last_sequence_number && ! saved_last_message_acked == last_message_acked) { ! debuglog(("Duplicate packet received...ignoring it\n")); return false; } // No blocks? just ACK it (if we're a server) if (msg->header.num_slots == 0) --- 146,191 ---- reply[ri] = (LAT_SlotCmd *)replybuf[ri]; #ifdef REALLY_VERBOSE_DEBUGLOG ! debuglog(("MSG: seq: %d, ack: %d (last sent seq = %d)\n", ! msg->header.sequence_number, msg->header.ack_number, last_sent_seq)); debuglog(("PREV:last seq: %d, last ack: %d\n", ! last_recv_seq, last_recv_ack)); #endif // Is this a duplicate? ! if (msg->header.ack_number == last_recv_ack && ! msg->header.sequence_number == last_recv_seq) { ! debuglog(("Duplicate packet received...resending ACK\n")); ! ! // But still send an ACK as it could be the ACK that went missing ! last_ack_message.send(interface, macaddr); ! ! // If the last DATA message wasn't seen either then resend that too ! if (last_message.get_seq() != msg->header.ack_number) ! last_message.send(interface, macaddr); return false; } + // PJC: Not sure about this + if (msg->header.ack_number != last_sent_seq) + { + debuglog(("Got ack for old message, resending ACK\n")); + last_ack_message.send(interface, macaddr); + + // If the last DATA message wasn't seen either then resend that too + if (last_message.get_seq() != msg->header.ack_number) + last_message.send(interface, macaddr); + } + + + window_size--; + if (window_size < 0) window_size = 0; + + need_ack = false; + last_recv_ack = msg->header.ack_number; + last_recv_seq = msg->header.sequence_number; + // No blocks? just ACK it (if we're a server) if (msg->header.num_slots == 0) *************** *** 429,433 **** // Send any replies - last_ack_number = last_message_acked; if (replyhere || num_replies) { --- 449,452 ---- *************** *** 448,452 **** } ! send_message(replybuf, ptr, REPLY); return true; } --- 467,484 ---- } ! if (window_size < max_window_size) ! { ! send_message(replybuf, ptr, REPLY); ! } ! else ! { ! header->local_connid = num; ! header->remote_connid = remote_connid; ! header->sequence_number = ++last_sent_seq; ! header->ack_number = last_recv_seq; ! ! pending.push(pending_msg(replybuf, len, false)); ! } ! return true; } *************** *** 494,522 **** if (type == DATA) { - retransmit_count = 0; - window_size++; - debuglog(("send_message, window_size now %d\n", window_size)); need_ack = true; } - if (type == REPLY) - { - need_ack = false; - } - - last_sequence_number++; - last_sent_sequence = last_sequence_number; - response->local_connid = num; response->remote_connid = remote_connid; ! response->sequence_number = last_sequence_number; ! response->ack_number = last_ack_number; ! debuglog(("Sending message for connid %d (seq: %d, ack: %d, needack: %d)\n", ! num, last_sequence_number, last_ack_number, (type==DATA) )); keepalive_timer = 0; ! if (type == DATA) last_message = pending_msg(buf, len, (type==DATA) ); return LATServer::Instance()->send_message(buf, len, interface, macaddr); } --- 526,551 ---- if (type == DATA) { need_ack = true; + window_size++; } response->local_connid = num; response->remote_connid = remote_connid; ! response->sequence_number = ++last_sent_seq; ! response->ack_number = last_recv_seq; ! ! retransmit_count = 0; ! last_sent_ack = last_recv_seq; ! debuglog(("Sending message for connid %d (seq: %d, ack: %d) window=%d\n", ! num, last_sent_seq, last_sent_ack, window_size )); keepalive_timer = 0; ! if (type == DATA) ! last_message = pending_msg(buf, len, true); ! else ! last_ack_message = pending_msg(buf, len, false); ! return LATServer::Instance()->send_message(buf, len, interface, macaddr); } *************** *** 530,535 **** response->local_connid = num; response->remote_connid = remote_connid; ! response->sequence_number = last_sequence_number; ! response->ack_number = last_ack_number; debuglog(("Queued messsge for connid %d\n", num)); --- 559,563 ---- response->local_connid = num; response->remote_connid = remote_connid; ! // SEQ and ACK filled in when we send it debuglog(("Queued messsge for connid %d\n", num)); *************** *** 604,610 **** void LATConnection::circuit_timer(void) { // Increment keepalive timer and trigger it if we are getting too close. ! // Keepalive time is help in milli-seconds. // Of course, we needn't send keepalive messages when we are a --- 632,671 ---- void LATConnection::circuit_timer(void) { + // Did we get an ACK for our last message? + if (need_ack && last_sent_seq != last_recv_ack) + { + if (++retransmit_count > LATServer::Instance()->get_retransmit_limit()) + { + debuglog(("hit retransmit limit on connection %d\n", num)); + + unsigned char buf[1600]; + LAT_Header *header = (LAT_Header *)buf; + int ptr = sizeof(LAT_Header); + + header->cmd = LAT_CCMD_DISCON; + header->num_slots = 0; + header->local_connid = num; + header->remote_connid = remote_connid; + header->sequence_number = ++last_sent_seq; + header->ack_number = last_recv_seq; + buf[ptr++] = 0x06; // Retransmission limit reached. + LATServer::Instance()->send_message(buf, ptr, interface, macaddr); + + // Set this connection pending deletion + LATServer::Instance()->delete_connection(num); + + // Mark this node as unavailable in the service list + LATServices::Instance()->remove_node(std::string((char *)remnode)); + return; + } + debuglog(("Last message not ACKed: RESEND\n")); + last_message.send(interface, macaddr); + return; + } + + retransmit_count = 0; // Increment keepalive timer and trigger it if we are getting too close. ! // Keepalive timer is held in milli-seconds. // Of course, we needn't send keepalive messages when we are a *************** *** 651,655 **** if (role == CLIENT) reply->header.cmd = LAT_CCMD_SESSION | 2; - window_size = 0; send_message(replybuf, sizeof(LAT_SessionReply), DATA); return; --- 712,715 ---- *************** *** 657,697 **** } - // Did we get an ACK for our last message? - if (need_ack && last_sequence_number != last_sent_sequence) - { - if (++retransmit_count > LATServer::Instance()->get_retransmit_limit()) - { - debuglog(("hit retransmit limit on connection %d\n", num)); - need_ack = false; - - unsigned char buf[1600]; - LAT_Header *header = (LAT_Header *)buf; - int ptr=sizeof(LAT_Header); - - header->cmd = LAT_CCMD_DISCON; - header->num_slots = 0; - header->local_connid = num; - header->remote_connid = remote_connid; - header->sequence_number = last_sequence_number; - header->ack_number = last_ack_number; - buf[ptr++] = 0x06; // Retransmission limit reached. - LATServer::Instance()->send_message(buf, ptr, interface, macaddr); - - LATServer::Instance()->delete_connection(num); - - // Mark this node as unavailable in the service list - LATServices::Instance()->remove_node(std::string((char *)remnode)); - return; - } - debuglog(("Last message not ACKed: RESEND\n")); - last_message.send(interface, macaddr); - return; - } - else - { - retransmit_count = 0; - need_ack = false; - } - // Poll our sessions for (unsigned int i=0; i<=highest_session; i++) --- 717,720 ---- *************** *** 707,711 **** unsigned char buf[1600]; LAT_Header *header = (LAT_Header *)buf; ! int len=sizeof(LAT_Header); if (role == SERVER) header->cmd = LAT_CCMD_SDATA; --- 730,735 ---- unsigned char buf[1600]; LAT_Header *header = (LAT_Header *)buf; ! int len = sizeof(LAT_Header); ! if (role == SERVER) header->cmd = LAT_CCMD_SDATA; *************** *** 713,720 **** header->cmd = LAT_CCMD_SESSION; header->num_slots = 0; - header->local_connid = num; - header->remote_connid = remote_connid; - header->sequence_number = last_sequence_number; - header->ack_number = last_ack_number; // Send as many slot data messages as we can --- 737,740 ---- *************** *** 727,737 **** memcpy(buf+len, cmd.get_buf(), cmd.get_len()); len += cmd.get_len(); ! if (len%2) len++;// Keep it on even boundary slots_pending.pop(); } if (header->num_slots) { ! debuglog(("Sending %d slots on circuit timer\n", header->num_slots)); pending.push(pending_msg(buf, len, true)); } --- 747,762 ---- memcpy(buf+len, cmd.get_buf(), cmd.get_len()); len += cmd.get_len(); ! if (len%2) len++; // Keep it on even boundary slots_pending.pop(); } + if (header->num_slots) { ! header->local_connid = num; ! header->remote_connid = remote_connid; ! // SEQ and ACK filled in when we send it ! ! debuglog(("Collected %d slots on circuit timer\n", header->num_slots)); pending.push(pending_msg(buf, len, true)); } *************** *** 741,770 **** if (!pending.empty()) { ! debuglog(("Window size: %d, max %d\n", window_size, max_window_size)); } #endif // Send a pending message (if we can) ! if (!pending.empty() && window_size < max_window_size) { // Send the top message pending_msg &msg(pending.front()); - last_sequence_number++; - last_sent_sequence = last_sequence_number; - need_ack = msg.needs_ack(); retransmit_count = 0; LAT_Header *header = msg.get_header(); ! header->sequence_number = last_sequence_number; ! header->ack_number = last_ack_number; ! debuglog(("Sending message on circuit timer: seq: %d, ack: %d (need_ack: %d)\n", ! last_sequence_number, last_ack_number, need_ack)); msg.send(interface, macaddr); last_message = msg; // Save it in case it gets lost on the wire; pending.pop(); - window_size++; keepalive_timer = 0; } --- 766,794 ---- if (!pending.empty()) { ! debuglog(("Pending messages. Window size: %d, max %d. last_ack=%d, last_seq=%d\n", ! window_size, max_window_size, last_recv_ack, last_sent_seq)); } #endif // Send a pending message (if we can) ! if (!pending.empty() && window_size < max_window_size)// && ! // last_sent_seq - last_recv_ack < max_window_size) { // Send the top message pending_msg &msg(pending.front()); retransmit_count = 0; + need_ack = true; LAT_Header *header = msg.get_header(); ! header->sequence_number = ++last_sent_seq; ! header->ack_number = last_recv_seq; ! debuglog(("Sending message on circuit timer: seq: %d, ack: %d\n", ! last_sent_seq, last_sent_ack)); msg.send(interface, macaddr); last_message = msg; // Save it in case it gets lost on the wire; pending.pop(); keepalive_timer = 0; } *************** *** 863,868 **** // Reset the sequence & ack numbers ! last_sequence_number = 0xff; ! last_ack_number = 0xff; remote_connid = 0; interface = this_int; --- 887,894 ---- // Reset the sequence & ack numbers ! last_recv_seq = 0xff; ! last_recv_ack = 0; ! last_sent_seq = 0xff; ! last_sent_ack = 0; remote_connid = 0; interface = this_int; *************** *** 999,1013 **** remote_connid = reply->header.local_connid; ! last_sequence_number = reply->header.ack_number; ! last_message_acked = reply->header.sequence_number; ! last_ack_number = last_message_acked; connected = true; connecting = false; max_window_size = reply->exqueued+1; ! max_window_size = 1; // All we can manage debuglog(("got connect ack. seq: %d, ack: %d\n", ! last_sequence_number, last_message_acked)); // Start clientsessions --- 1025,1041 ---- remote_connid = reply->header.local_connid; ! last_recv_ack = reply->header.ack_number; ! last_recv_seq = reply->header.sequence_number; ! connected = true; connecting = false; max_window_size = reply->exqueued+1; ! max_window_size = 1; // PJC All we can manage ! window_size = 0; ! need_ack = false; debuglog(("got connect ack. seq: %d, ack: %d\n", ! last_recv_seq, last_recv_ack)); // Start clientsessions Index: connection.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** connection.h 15 Feb 2002 13:24:13 -0000 1.22 --- connection.h 28 Feb 2002 17:52:43 -0000 1.23 *************** *** 61,66 **** int remote_connid; // Remote Connection ID int keepalive_timer; // Counting up. ! unsigned char last_sequence_number; ! unsigned char last_ack_number; unsigned int next_session; unsigned int highest_session; --- 61,68 ---- int remote_connid; // Remote Connection ID int keepalive_timer; // Counting up. ! unsigned char last_sent_seq; ! unsigned char last_sent_ack; ! unsigned char last_recv_seq; ! unsigned char last_recv_ack; unsigned int next_session; unsigned int highest_session; *************** *** 72,77 **** LATSession *sessions[256]; - unsigned char last_sent_sequence; // Last sequence number we sent - unsigned char last_message_acked; bool need_ack; bool queued; // Client for queued connection. --- 74,77 ---- *************** *** 95,112 **** pending_msg() {} pending_msg(unsigned char *_buf, int _len, bool _need_ack): ! len(_len), ! need_ack(_need_ack) { memcpy(buf, _buf, len); } pending_msg(const pending_msg &msg): ! len(msg.len), ! need_ack(msg.need_ack) ! { ! memcpy(buf, msg.buf, len); ! } ~pending_msg() ! { ! } pending_msg &operator=(const pending_msg &a) --- 95,112 ---- pending_msg() {} pending_msg(unsigned char *_buf, int _len, bool _need_ack): ! len(_len), ! need_ack(_need_ack) { memcpy(buf, _buf, len); } pending_msg(const pending_msg &msg): ! len(msg.len), ! need_ack(msg.need_ack) ! { ! memcpy(buf, msg.buf, len); ! } ~pending_msg() ! { ! } pending_msg &operator=(const pending_msg &a) *************** *** 130,133 **** --- 130,134 ---- LAT_Header *get_header() { return (LAT_Header *)buf;} bool needs_ack() { return need_ack;} + unsigned char get_seq() { LAT_Header *h=(LAT_Header *)buf; return h->sequence_number;} private: *************** *** 175,178 **** --- 176,180 ---- int max_slots_per_packet; pending_msg last_message; // In case we need to resend it. + pending_msg last_ack_message; // In case we need to resend it. int retransmit_count; |
From: Patrick C. <pa...@us...> - 2002-02-21 16:16:07
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv14385 Modified Files: server.cc localport.h server.h Log Message: gcc 3.0 fixes. Index: server.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.cc,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -r1.54 -r1.55 *** server.cc 13 Feb 2002 16:59:13 -0000 1.54 --- server.cc 21 Feb 2002 16:16:03 -0000 1.55 *************** *** 1238,1242 **** // Return the command info for a service ! int LATServer::get_service_info(char *name, string &cmd, int &maxcon, uid_t &uid, gid_t &gid) { // Look for it. --- 1238,1242 ---- // Return the command info for a service ! int LATServer::get_service_info(char *name, std::string &cmd, int &maxcon, uid_t &uid, gid_t &gid) { // Look for it. Index: localport.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/localport.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** localport.h 8 Feb 2002 15:07:30 -0000 1.3 --- localport.h 21 Feb 2002 16:16:03 -0000 1.4 *************** *** 28,32 **** void show_info(bool verbose, std::ostrstream &output); void close_and_delete(); ! const string &get_devname() { return devname; }; void init_port(); --- 28,32 ---- void show_info(bool verbose, std::ostrstream &output); void close_and_delete(); ! const std::string &get_devname() { return devname; }; void init_port(); Index: server.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.h,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -r1.34 -r1.35 *** server.h 13 Feb 2002 16:59:13 -0000 1.34 --- server.h 21 Feb 2002 16:16:03 -0000 1.35 *************** *** 49,53 **** void send_connect_error(int reason, LAT_Header *msg, int interface, unsigned char *macaddr); bool is_local_service(char *); ! int get_service_info(char *name, string &cmd, int &maxcon, uid_t &uid, gid_t &gid); gid_t get_lat_group() { return lat_group; } LATConnection *get_connection(int id) { return connections[id]; } --- 49,53 ---- void send_connect_error(int reason, LAT_Header *msg, int interface, unsigned char *macaddr); bool is_local_service(char *); ! int get_service_info(char *name, std::string &cmd, int &maxcon, uid_t &uid, gid_t &gid); gid_t get_lat_group() { return lat_group; } LATConnection *get_connection(int id) { return connections[id]; } |
From: Patrick C. <pa...@us...> - 2002-02-21 11:14:04
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory usw-pr-cvs1:/tmp/cvs-serv16486 Modified Files: control Log Message: Suggests: iproute remove trailing blanks. Index: control =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/control,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** control 8 Dec 2001 12:20:11 -0000 1.18 --- control 21 Feb 2002 11:14:00 -0000 1.19 *************** *** 4,8 **** Maintainer: Patrick Caulfield <pa...@de...> Build-Depends: debhelper, libncurses5-dev ! Standards-Version: 3.5.5 Package: dnet-common --- 4,8 ---- Maintainer: Patrick Caulfield <pa...@de...> Build-Depends: debhelper, libncurses5-dev ! Standards-Version: 3.5.6 Package: dnet-common *************** *** 12,17 **** Section: net Conflicts: dnprogs Description: Base package for Linux DECnet ! This is the base package for Linux DECnet. it contains the necessary configuration files and a script to set up the MAC address of your ethernet card(s) at boot-up. --- 12,18 ---- Section: net Conflicts: dnprogs + Suggests: iproute Description: Base package for Linux DECnet ! This is the base package for Linux DECnet. it contains the necessary configuration files and a script to set up the MAC address of your ethernet card(s) at boot-up. *************** *** 19,24 **** You will also need to be running a 2.4+ kernel and have DECnet either built as a module or compiled into the kernel. ! . ! To do useful work with DECnet you will need the libdnet package and probably also dnet-progs. --- 20,25 ---- You will also need to be running a 2.4+ kernel and have DECnet either built as a module or compiled into the kernel. ! . ! To do useful work with DECnet you will need the libdnet package and probably also dnet-progs. *************** *** 30,34 **** Description: DECnet user programs and daemons These tools are the application layer interface for DECnet on Linux systems. ! They provide file/terminal access facilities between OpenVMS and Linux and remote execution of commands. Also included is a Linux version of the VMS "Phone" utility and a VMSMail --- 31,35 ---- Description: DECnet user programs and daemons These tools are the application layer interface for DECnet on Linux systems. ! They provide file/terminal access facilities between OpenVMS and Linux and remote execution of commands. Also included is a Linux version of the VMS "Phone" utility and a VMSMail *************** *** 41,51 **** Section: libs Description: DECnet Libraries ! This package contains the libraries necessary for a functioning DECnet ! system. Most DECnet programs require these libraries to be present on the system. The libraries are: libdnet - the basic DECnet API as featured on Ultrix(R) systems libdnet_daemon - useful calls for writing DECnet daemons libdap - DAP (Data Access Protocol) C++ classes ! librms - High level library for programmatic access VMS files from Linux. --- 42,52 ---- Section: libs Description: DECnet Libraries ! This package contains the libraries necessary for a functioning DECnet ! system. Most DECnet programs require these libraries to be present on the system. The libraries are: libdnet - the basic DECnet API as featured on Ultrix(R) systems libdnet_daemon - useful calls for writing DECnet daemons libdap - DAP (Data Access Protocol) C++ classes ! librms - High level library for programmatic access VMS files from Linux. |
From: Patrick C. <pa...@us...> - 2002-02-16 16:27:49
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv19923 Modified Files: connection.cc Log Message: Send keepalives 3 seconds before we have to. Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -r1.39 -r1.40 *** connection.cc 15 Feb 2002 13:24:13 -0000 1.39 --- connection.cc 16 Feb 2002 16:27:47 -0000 1.40 *************** *** 629,633 **** last_time = time_in_msec; ! if (keepalive_timer > (LATServer::Instance()->get_keepalive_timer()-1)*1000 ) { // Send an empty message that needs an ACK. --- 629,633 ---- last_time = time_in_msec; ! if (keepalive_timer > (LATServer::Instance()->get_keepalive_timer()-3)*1000 ) { // Send an empty message that needs an ACK. |
From: Patrick C. <pa...@us...> - 2002-02-16 16:26:13
|
Update of /cvsroot/linux-decnet/latd/debian In directory usw-pr-cvs1:/tmp/cvs-serv19533/debian Modified Files: changelog Log Message: Changelog for 1.13 Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/latd/debian/changelog,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** changelog 11 Feb 2002 16:39:35 -0000 1.7 --- changelog 16 Feb 2002 16:26:08 -0000 1.8 *************** *** 1,2 **** --- 1,18 ---- + latd (1.13-1) unstable; urgency=low + + * Fail attempts to create /dev/lat ports twice + * Delete /dev/lat ports when latcp -D -p is run + (thanks to Denis Komissaro) for those two. + * Use local name in ENQ message for DS90L servers instead of the + stupid one I left in there after testing. + * Get rid of spurious "Queued" status messages and put the + service name in there. + * Fix multiple queued connections to the same server that I broke in 1.11 + * Don't make queued connection queries interfere with existing services table + * Restrict data slots to 250 bytes so as not to break DECserver 200s + * Made the keepalive timer less susceptible to drift on busy systems. + + -- Patrick Caulfield <pa...@de...> Sat, 16 Feb 2002 16:25:52 +0000 + latd (1.12-1) unstable; urgency=low *************** *** 22,26 **** 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. --- 38,42 ---- 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. *************** *** 32,36 **** * 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 --- 48,52 ---- * 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 *************** *** 49,53 **** * Fixed EOF trapping on local ports * Fixed latcp -d display of local ports (node & service were swapped) ! * Changed example latd.conf to show we can connect to services without specifying a node name now * Closes: bug#85288 --- 65,69 ---- * Fixed EOF trapping on local ports * Fixed latcp -d display of local ports (node & service were swapped) ! * Changed example latd.conf to show we can connect to services without specifying a node name now * Closes: bug#85288 *************** *** 76,80 **** ports with no other privileges * Added startup script ! * Remove "LAT started", "LAT stopped" messages from latcp as they interfere with the startup script and it's "not the Unix way" * Added RPM build target --- 92,96 ---- ports with no other privileges * Added startup script ! * Remove "LAT started", "LAT stopped" messages from latcp as they interfere with the startup script and it's "not the Unix way" * Added RPM build target |
From: Patrick C. <pa...@us...> - 2002-02-15 15:31:46
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv5340 Modified Files: latcp.8 Log Message: Document restrictions on numerics Index: latcp.8 =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcp.8,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** latcp.8 12 Feb 2002 11:03:15 -0000 1.9 --- latcp.8 15 Feb 2002 15:31:37 -0000 1.10 *************** *** 19,24 **** Start the LAT daemon. This is the only way to start LAT, you should not attempt to run latd directly or you may get unexpected behviour. ! .B latcp -s ! runs the file .B /etc/latd.conf as a shell script (using /bin/sh). Any customisations you need to do to the --- 19,24 ---- Start the LAT daemon. This is the only way to start LAT, you should not attempt to run latd directly or you may get unexpected behviour. ! .B latcp -s ! runs the file .B /etc/latd.conf as a shell script (using /bin/sh). Any customisations you need to do to the *************** *** 28,32 **** .B latd.conf(5). .br ! .B latcp -s passes any extra switches onto latd itself so you can customise latd this way, however latd.conf is recommended. --- 28,32 ---- .B latd.conf(5). .br ! .B latcp -s passes any extra switches onto latd itself so you can customise latd this way, however latd.conf is recommended. *************** *** 44,48 **** latcp -A -a service [-i description] [-r rating] [-s] [-C command] [-u user] .br ! The .B -s flag indicates that the service rating is static. Without this the --- 44,48 ---- latcp -A -a service [-i description] [-r rating] [-s] [-C command] [-u user] .br ! The .B -s flag indicates that the service rating is static. Without this the *************** *** 57,61 **** 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: --- 57,61 ---- The .B -u ! flag specifies a user to run the above command as. By default this will be root. .br The syntax for creating a reverse LAT port is: *************** *** 63,72 **** latcp -A -p tty -V learned_service [-R rem_port] [-H rem_node] [-Q] [-8] .br ! The tty name should start /dev/lat and must not exist. The .B -Q flag indicates that connections to the service is queued. If you connect to a queued service and it is busy then your connection will be forced to wait until it is available. You must use this flag ! for printer services on DECserver 90L terminal servers. .br The --- 63,73 ---- latcp -A -p tty -V learned_service [-R rem_port] [-H rem_node] [-Q] [-8] .br ! The tty name should start /dev/lat and must not exist. The .B -Q flag indicates that connections to the service is queued. If you connect to a queued service and it is busy then your connection will be forced to wait until it is available. You must use this flag ! for printer services on DECserver 90L terminal servers, and in this case ! the service name must also be empty. .br The *************** *** 92,96 **** latcp -i <description> -a <service> .BR ! If the description contains spaces or shell metacharacters you should enclose it in quotes. --- 93,97 ---- latcp -i <description> -a <service> .BR ! If the description contains spaces or shell metacharacters you should enclose it in quotes. *************** *** 99,103 **** .I \-J Enables the service responder. This feature is needed for small ! terminal servers that do not collect their own service lists. I currently don't have a list of servers that need this feature. can anyone help?? --- 100,104 ---- .I \-J Enables the service responder. This feature is needed for small ! terminal servers that do not collect their own service lists. I currently don't have a list of servers that need this feature. can anyone help?? *************** *** 109,113 **** .TP .I \-Y ! Purges the list of known services from latds internal tables. --- 110,114 ---- .TP .I \-Y ! Purges the list of known services from latd's internal tables. *************** *** 137,142 **** number is exceeded then the connection is closed as it is assumed that the remote end has gone away. ! .br ! The default value is 20. .TP --- 138,142 ---- number is exceeded then the connection is closed as it is assumed that the remote end has gone away. ! This value must be between 4 and 120 inclusive, the default is 20. .TP *************** *** 144,148 **** Sets the multicast timer (in seconds). This timer determines how often services are advertised on the LAN. The default is 60 seconds. ! .TP --- 144,148 ---- Sets the multicast timer (in seconds). This timer determines how often services are advertised on the LAN. The default is 60 seconds. ! This value must be between 10 and 180 inclusive. .TP *************** *** 152,156 **** an empty message is sent to the remote end. If it does not respond after <retransmit limit> then the connection is closed. This timer ! is reset every time a packet is sent out. --- 152,157 ---- an empty message is sent to the remote end. If it does not respond after <retransmit limit> then the connection is closed. This timer ! is reset every time a packet is sent out. This value must be ! between 10 and 180 inclusive. *************** *** 162,166 **** that are advertised by this node. .B -d -l ! will display the learned service table. Adding .B -v will show the learned service table in a verbose manner. --- 163,167 ---- that are advertised by this node. .B -d -l ! will display the learned service table. Adding .B -v will show the learned service table in a verbose manner. *************** *** 172,176 **** .TP .I \-G ! Add groups to the services advertised. The groups can be numbers seperated by commas or a range. eg .br --- 173,177 ---- .TP .I \-G ! Add groups to the services advertised. The groups can be numbers seperated by commas or a range. eg .br *************** *** 198,200 **** .SS SEE ALSO ! .BR latd "(8), "latd.conf "(5), " llogin "(1)" --- 199,201 ---- .SS SEE ALSO ! .BR latd "(8), "latd.conf "(5), "moprc "(8), " llogin "(1)" |
From: Patrick C. <pa...@us...> - 2002-02-15 13:35:27
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv3157 Modified Files: latcp.cc Log Message: Restrict numeric server parameters to the values also accepted by VMS and several terminal servers. Index: latcp.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcp.cc,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** latcp.cc 15 Feb 2002 13:24:13 -0000 1.30 --- latcp.cc 15 Feb 2002 13:35:24 -0000 1.31 *************** *** 465,469 **** void set_multicast(int newtime) { ! if (newtime < 1 || newtime > 32767) { fprintf(stderr, "invalid multicast time\n"); --- 465,469 ---- void set_multicast(int newtime) { ! if (newtime < 10 || newtime > 180) { fprintf(stderr, "invalid multicast time\n"); *************** *** 477,481 **** void set_retransmit(int newlim) { ! if (newlim < 1 || newlim > 32767) { fprintf(stderr, "invalid retransmit limit\n"); --- 477,481 ---- void set_retransmit(int newlim) { ! if (newlim < 4 || newlim > 120) { fprintf(stderr, "invalid retransmit limit\n"); *************** *** 489,493 **** void set_keepalive(int newtime) { ! if (newtime < 10 || newtime > 32767) { fprintf(stderr, "invalid keepalive timer\n"); --- 489,493 ---- void set_keepalive(int newtime) { ! if (newtime < 10 || newtime > 180) { fprintf(stderr, "invalid keepalive timer\n"); |
From: Patrick C. <pa...@us...> - 2002-02-15 13:24:17
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv31768 Modified Files: connection.cc latcp.cc llogin.cc session.cc connection.h Log Message: Change the way the keepalive timeouts are calculated so we don't get clock-drift on busy systems. Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -r1.38 -r1.39 *** connection.cc 13 Feb 2002 16:59:12 -0000 1.38 --- connection.cc 15 Feb 2002 13:24:13 -0000 1.39 *************** *** 53,56 **** --- 53,57 ---- last_sequence_number(_ack), last_ack_number(_seq), + last_time(0L), queued_slave(false), eightbitclean(false), *************** *** 97,100 **** --- 98,102 ---- last_sequence_number(0xff), last_ack_number(0xff), + last_time(0L), queued(queued), queued_slave(false), *************** *** 603,609 **** { ! // Increment keepalive timer - timer is measured in the same units ! // as the circut timer(100ths/sec) but the keepalive timer in the Server ! // is measured in seconds. // Of course, we needn't send keepalive messages when we are a --- 605,610 ---- { ! // Increment keepalive timer and trigger it if we are getting too close. ! // Keepalive time is help in milli-seconds. // Of course, we needn't send keepalive messages when we are a *************** *** 612,625 **** (role == CLIENT && connected)) { ! keepalive_timer += LATServer::Instance()->get_circuit_timer(); ! if (keepalive_timer > LATServer::Instance()->get_keepalive_timer()*100 ) { // Send an empty message that needs an ACK. // If we don't get a response to this then we abort the circuit. debuglog(("keepalive timer expired: %d: limit: %d\n", keepalive_timer, ! LATServer::Instance()->get_keepalive_timer()*100)); // If we get into this block then there is no chance that there is ! // an outstanding ack (or if there is then it's all gone horribly wrong anyway // so it's safe to just send a NULL message out. // If we do exqueued properly this may need revisiting. --- 613,641 ---- (role == CLIENT && connected)) { ! struct timeval tv; ! long time_in_msec; ! ! // Initialise last_time for the first time ! if (last_time == 0) ! { ! gettimeofday(&tv, NULL); ! last_time = tv.tv_sec*1000 + tv.tv_usec/1000; ! } ! ! gettimeofday(&tv, NULL); ! time_in_msec = tv.tv_sec*1000 + tv.tv_usec/1000; ! ! keepalive_timer += time_in_msec - last_time; ! last_time = time_in_msec; ! ! if (keepalive_timer > (LATServer::Instance()->get_keepalive_timer()-1)*1000 ) { // Send an empty message that needs an ACK. // If we don't get a response to this then we abort the circuit. debuglog(("keepalive timer expired: %d: limit: %d\n", keepalive_timer, ! LATServer::Instance()->get_keepalive_timer()*1000)); // If we get into this block then there is no chance that there is ! // an outstanding ack (or if there is then it's all gone horribly wrong anyway) // so it's safe to just send a NULL message out. // If we do exqueued properly this may need revisiting. *************** *** 635,639 **** if (role == CLIENT) reply->header.cmd = LAT_CCMD_SESSION | 2; ! send_message(replybuf, sizeof(LAT_SessionReply), DATA); return; --- 651,655 ---- if (role == CLIENT) reply->header.cmd = LAT_CCMD_SESSION | 2; ! window_size = 0; send_message(replybuf, sizeof(LAT_SessionReply), DATA); return; Index: latcp.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcp.cc,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** latcp.cc 8 Feb 2002 15:24:18 -0000 1.29 --- latcp.cc 15 Feb 2002 13:24:13 -0000 1.30 *************** *** 465,469 **** void set_multicast(int newtime) { ! if (newtime == 0 || newtime > 32767) { fprintf(stderr, "invalid multicast time\n"); --- 465,469 ---- void set_multicast(int newtime) { ! if (newtime < 1 || newtime > 32767) { fprintf(stderr, "invalid multicast time\n"); *************** *** 477,481 **** void set_retransmit(int newlim) { ! if (newlim == 0 || newlim > 32767) { fprintf(stderr, "invalid retransmit limit\n"); --- 477,481 ---- void set_retransmit(int newlim) { ! if (newlim < 1 || newlim > 32767) { fprintf(stderr, "invalid retransmit limit\n"); *************** *** 489,493 **** void set_keepalive(int newtime) { ! if (newtime == 0 || newtime > 32767) { fprintf(stderr, "invalid keepalive timer\n"); --- 489,493 ---- void set_keepalive(int newtime) { ! if (newtime < 10 || newtime > 32767) { fprintf(stderr, "invalid keepalive timer\n"); Index: llogin.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/llogin.cc,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** llogin.cc 8 Feb 2002 15:07:30 -0000 1.13 --- llogin.cc 15 Feb 2002 13:24:13 -0000 1.14 *************** *** 248,252 **** int ret; ret = read_reply(latcp_socket, cmd, result, len); ! if (ret) return ret; // If the reply was good then go into terminal mode. --- 248,253 ---- int ret; ret = read_reply(latcp_socket, cmd, result, len); ! if (ret) ! return ret; // If the reply was good then go into terminal mode. *************** *** 375,379 **** } ! // Read from keyboard. One at a time if (FD_ISSET(termfd, &in_set)) { --- 376,380 ---- } ! // Read from keyboard if (FD_ISSET(termfd, &in_set)) { Index: session.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/session.cc,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** session.cc 13 Feb 2002 16:38:40 -0000 1.30 --- session.cc 15 Feb 2002 13:24:13 -0000 1.31 *************** *** 140,144 **** } #else ! debuglog(("Session %d From PTY(%d)\n", local_session, msglen)); #endif --- 140,144 ---- } #else ! // debuglog(("Session %d From PTY(%d)\n", local_session, msglen)); #endif Index: connection.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** connection.h 13 Feb 2002 16:59:13 -0000 1.21 --- connection.h 15 Feb 2002 13:24:13 -0000 1.22 *************** *** 69,72 **** --- 69,73 ---- unsigned char portname[255]; unsigned char remnode[255]; + unsigned long last_time; LATSession *sessions[256]; |
From: Patrick C. <pa...@us...> - 2002-02-15 09:36:57
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv31002 Modified Files: utils.cc Log Message: Timestamp log messages Index: utils.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/utils.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** utils.cc 11 Feb 2002 14:09:38 -0000 1.4 --- utils.cc 15 Feb 2002 09:36:53 -0000 1.5 *************** *** 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 *************** *** 16,28 **** #include <sys/fcntl.h> #include <string.h> #include <stdio.h> #include "utils.h" ! void add_string(unsigned char *packet, int *ptr, const unsigned char *string) { int len = strlen((char *)string); ! packet[(*ptr)++] = len; strcpy((char *)packet + *ptr, (char *)string); --- 16,29 ---- #include <sys/fcntl.h> #include <string.h> + #include <time.h> #include <stdio.h> #include "utils.h" ! void add_string(unsigned char *packet, int *ptr, const unsigned char *string) { int len = strlen((char *)string); ! packet[(*ptr)++] = len; strcpy((char *)packet + *ptr, (char *)string); *************** *** 30,38 **** } ! void get_string(unsigned char *packet, int *ptr, unsigned char *string) { int len = packet[(*ptr)++]; ! strncpy((char*)string, (char*)packet + *ptr, len); string[len] = '\0'; --- 31,39 ---- } ! void get_string(unsigned char *packet, int *ptr, unsigned char *string) { int len = packet[(*ptr)++]; ! strncpy((char*)string, (char*)packet + *ptr, len); string[len] = '\0'; *************** *** 43,51 **** void pjc_debuglog(char *fmt, ...) { ! va_list ap; ! ! va_start(ap, fmt); ! vfprintf(stderr, fmt, ap); } #endif --- 44,53 ---- void pjc_debuglog(char *fmt, ...) { ! static time_t starttime = time(NULL); ! va_list ap; ! fprintf(stderr, "%5ld: ", time(NULL)-starttime); ! va_start(ap, fmt); ! vfprintf(stderr, fmt, ap); } #endif *************** *** 54,58 **** #ifdef INTERNAL_OPENPTY int pjc_openpty(int *master, int *slave, char *a, char *b, char *d) ! { char ptyname[] = "/dev/ptyCP"; char c; --- 56,60 ---- #ifdef INTERNAL_OPENPTY int pjc_openpty(int *master, int *slave, char *a, char *b, char *d) ! { char ptyname[] = "/dev/ptyCP"; char c; *************** *** 69,77 **** line[strlen("/dev/ptyC")] = '0'; if (stat(line,&stb) < 0) ! break; for (i=0; i < 16; i++) { line[strlen("/dev/ptyC")]= "0123456789abcdef"[i]; ! if ( (pty=open(line,O_RDWR)) > 0) { gotpty = 1; --- 71,79 ---- line[strlen("/dev/ptyC")] = '0'; if (stat(line,&stb) < 0) ! break; for (i=0; i < 16; i++) { line[strlen("/dev/ptyC")]= "0123456789abcdef"[i]; ! if ( (pty=open(line,O_RDWR)) > 0) { gotpty = 1; *************** *** 82,94 **** } ! if (!gotpty) { debuglog(("No ptys available for connection")); return -1; } ! line[strlen("/dev/")] = 't'; ! if ( (t=open(line,O_RDWR)) < 0) { debuglog(("Error connecting to physical terminal: %m")); --- 84,96 ---- } ! if (!gotpty) { debuglog(("No ptys available for connection")); return -1; } ! line[strlen("/dev/")] = 't'; ! if ( (t=open(line,O_RDWR)) < 0) { debuglog(("Error connecting to physical terminal: %m")); |
From: Patrick C. <pa...@us...> - 2002-02-13 19:42:05
|
Update of /cvsroot/linux-decnet/dnprogs/apps In directory usw-pr-cvs1:/tmp/cvs-serv2381 Modified Files: sethost.c Log Message: Ed Calderon's fixes to sethost for RSX-11 and DNI Index: sethost.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/apps/sethost.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** sethost.c 21 Oct 2001 14:24:00 -0000 1.4 --- sethost.c 13 Feb 2002 19:41:59 -0000 1.5 *************** *** 8,11 **** --- 8,13 ---- Paul Koning: Support for other than VMS servers. + ECalderon: + -----------------------------------------------------------------------------*/ *************** *** 41,45 **** TRUE,TRUE,TRUE,TRUE,80,24,0,0, 0,1,1,1,1}; - struct physical_terminal_characteristics phy_char = {9600,9600,8,FALSE,1,FALSE,FALSE, --- 43,46 ---- *************** *** 70,78 **** unsigned char escbuf[32]; ! static void usage(char *prog, FILE *f) { ! fprintf(f, "\nUSAGE: %s [OPTIONS] node\n\n", prog); --- 71,124 ---- unsigned char escbuf[32]; + static int debug=0; /*ed*/ + unsigned char tty; /*moved from dterm_bind_reply ed*/ + static int htype; /*ed*/ ! /* Routines in this program: static void usage(char *prog, FILE *f) + void set_exit_char(char *string) + inline void set_short(short *dest, short src) + static void ct_reset_term(void) + short escseq_terminator(char car) + static void ct_terminate_read(char flgs) + static short ct_is_terminator(char car) + static void ct_timeout_proc(int x) + static void ct_echo_input_char(char *c) + static void ct_echo_input_char(char *c) + static void ct_input_proc (char car) + static int ct_out_of_band (int car) + static void ct_setup(void) + static unsigned char read_ahead(void) + static int insert_ahead(char c) + static void dterm_bind_reply (void) + static void ct_setup_link(void) + static void ct_init_term(void) + static void ct_preinput_proc(int x) + static void rsts_preinput_proc(int x) + static void rsx_preinput_proc(int x) + static void tops_preinput_proc(int x) + static void ct_print_char(char *c) + static void ct_echo_prompt(char *c) + static void ct_read_req(void) + static void ct_unread_req(void) + static void ct_clearinput_req(void) + static void ct_write_req(void) + static void ct_readchar_req(void) + static void ct_writechar_req(void) + static void ct_checkinput_req(void) + static void ct_read_pkt(void) + static void proc_rsts_pkt(void) + static void proc_rsx_pkt(void) + static void proc_tops_pkt(void) + static void proc_cterm_pkt (void) + static void ct_proc_pkt(void) + int main(int argc, char *argv[]) + */ + /*-------------------------------------------------------------------------*/ + static void usage(char *prog, FILE *f) + { ! if (debug == 2) { printf(" Entered static void usage...\n");} ! fprintf(f, "\nUSAGE: %s [OPTIONS] node\n\n", prog); *************** *** 81,92 **** fprintf(f," -V show version number\n"); fprintf(f," -e <char> set escape char\n"); fprintf(f,"\n"); } ! void set_exit_char(char *string) { int newchar = 0; ! if (string[0] == '^') { --- 127,140 ---- fprintf(f," -V show version number\n"); fprintf(f," -e <char> set escape char\n"); + fprintf(f," -d debug information\n"); + fprintf(f," -t trace procedure entry\n"); fprintf(f,"\n"); } ! /*-------------------------------------------------------------------------*/ void set_exit_char(char *string) { int newchar = 0; ! if (debug == 2) { printf(" Entered void set_exit_char...\n");} if (string[0] == '^') { *************** *** 98,107 **** // Make sure it's resaonable if (newchar > 0 && newchar < 256) exit_char = newchar; ! } /*-------------------------------------------------------------------------*/ inline void set_short(short *dest, short src) ! { /* I've assumed that BIG-ENDIAN means SPARC in this context and that SPARCs are fussy about alignment. --- 146,155 ---- // Make sure it's resaonable if (newchar > 0 && newchar < 256) exit_char = newchar; ! } /*-------------------------------------------------------------------------*/ inline void set_short(short *dest, short src) ! { if (debug == 2) { printf(" Entered inline void set_short...\n");} /* I've assumed that BIG-ENDIAN means SPARC in this context and that SPARCs are fussy about alignment. *************** *** 117,121 **** /*-------------------------------------------------------------------------*/ static void ct_reset_term(void) ! { if ( ioctl(ttyfd,TCSETA,&cooked) < 0) { --- 165,169 ---- /*-------------------------------------------------------------------------*/ static void ct_reset_term(void) ! { if (debug == 2) { printf(" Entered static void ct_reset_term...\n");} if ( ioctl(ttyfd,TCSETA,&cooked) < 0) { *************** *** 130,136 **** char escend [23] = {'A','B','C','D','M','P','Q','R','S', 'l','m','n','p','q','r','s','t','u','v', ! 'w','x','y','~'}; int i; for (i=0; i < 23; i++) if (car==escend[i]) return 1; return 0; --- 178,186 ---- char escend [23] = {'A','B','C','D','M','P','Q','R','S', 'l','m','n','p','q','r','s','t','u','v', ! 'w','x','Y','~'}; ! int i; + if (debug == 2) { printf(" Entered short escseq_terminator...\n");} for (i=0; i < 23; i++) if (car==escend[i]) return 1; return 0; *************** *** 143,146 **** --- 193,197 ---- short *p; int i; + if (debug == 2) { printf(" Entered static void ct_terminate_read...\n");} read_present = FALSE; *************** *** 184,188 **** { short termind,msk,aux; ! termind=car / 8; aux = car - (termind * 8); --- 235,242 ---- { short termind,msk,aux; ! if (debug == 2) { printf(" Entered static short ct_is_terminator...\n");} ! /*printf(" Htype = %d",htype); ed*/ ! if (( htype == 12 ) && (car > 97) && (car < 123) ) { car = car - 32;} ! if (debug == 1) {printf(" car = %d\n",car);} /*ed*/ termind=car / 8; aux = car - (termind * 8); *************** *** 195,199 **** /*-------------------------------------------------------------------------*/ static void ct_timeout_proc(int x) ! { ct_terminate_read(5); signal(SIGALRM,ct_timeout_proc); --- 249,253 ---- /*-------------------------------------------------------------------------*/ static void ct_timeout_proc(int x) ! { if (debug == 2) { printf(" Entered static void ct_timeout_proc...\n");} ct_terminate_read(5); signal(SIGALRM,ct_timeout_proc); *************** *** 203,206 **** --- 257,262 ---- { char car; + if (debug == 2) { printf(" Entered static void ct_echo_input_char...\n");} + if ((n) || ((t==0) && ct_is_terminator(*c))) return; while (lockflg||hold) ; *************** *** 218,221 **** --- 274,278 ---- { char clrchar[3] = {0x08,0x20,0x08}; + if (debug == 2) { printf(" Entered static void ct_input_proc...\n");} if ((car == DEL) && ( (zz == 2) || (!ct_is_terminator(car)))) *************** *** 263,267 **** char msg[7] = {0x09,0x00,0x03,0x00,0x04,0x00,0x00}; char oo,d,i,ee,f; ! if (flavor != CTERM) return 0; --- 320,325 ---- char msg[7] = {0x09,0x00,0x03,0x00,0x04,0x00,0x00}; char oo,d,i,ee,f; ! if (debug == 2) { printf(" Entered static int ct_out_of_band...\n");} ! if (flavor != CTERM) return 0; *************** *** 304,307 **** --- 362,366 ---- { int i; + if (debug == 2) { printf(" Entered static void ct_setup...\n");} for (i=0; i < 32; i++) term_tab[i]=0; *************** *** 320,324 **** { char c; ! if ((rptr+wrpflg) == wptr) return -1; c=ahead[rptr]; --- 379,384 ---- { char c; ! if (debug == 2) { printf(" Entered static unsigned char read_ahead...\n");} ! if ((rptr+wrpflg) == wptr) return -1; c=ahead[rptr]; *************** *** 335,339 **** char buf[6] = {0x09,0x00,0x02,0x00,0x0E,0x01}; ! if (( rptr == wptr) && (wrpflg) ) return -1; ahead[wptr] = c; --- 395,399 ---- char buf[6] = {0x09,0x00,0x02,0x00,0x0E,0x01}; ! if (debug == 2) { printf(" Entered insert_ahead...\n");} if (( rptr == wptr) && (wrpflg) ) return -1; ahead[wptr] = c; *************** *** 343,347 **** if ( (aheadcnt == 1) && (han_char.input_count_state > 1) ) { ! if (!read_present) { if ( (er=write(sockfd,buf,6)) < 0 ) --- 403,407 ---- if ( (aheadcnt == 1) && (han_char.input_count_state > 1) ) { ! if (!read_present) { if ( (er=write(sockfd,buf,6)) < 0 ) *************** *** 360,364 **** unsigned char rsts_bind[3] = {0x01,0x03,0x00}; unsigned char rsts_ctrl[8] = {0x02,0x08,0x00,0x01,0x09,0x01,0x00,0x00}; ! unsigned char tty; switch (flavor) --- 420,428 ---- unsigned char rsts_bind[3] = {0x01,0x03,0x00}; unsigned char rsts_ctrl[8] = {0x02,0x08,0x00,0x01,0x09,0x01,0x00,0x00}; ! /* unsigned char tty; now declared global ED*/ ! unsigned char rsxm_bind[3] = {0x01,0x03,0x00}; ! unsigned char rsxm_ctrl[8] = {0x02,0x08,0x00,0x01,0x04,0x02,0x00,0x00}; ! int i; /*ed*/ ! if (debug == 2) { printf(" Entered static void dterm_bind_reply...\n");} switch (flavor) *************** *** 374,378 **** if (!(cooked.c_iflag & ISTRIP)) tty |= 64; /* 8-bit support */ ! if ((cooked.c_oflag & TABDLY) != XTABS) tty |= 2; /* hardware tab */ if (!(cooked.c_lflag & XCASE)) --- 438,442 ---- if (!(cooked.c_iflag & ISTRIP)) tty |= 64; /* 8-bit support */ ! if ((cooked.c_oflag & TABDLY) != XTABS) tty |= 2; /* hardware tab */ if (!(cooked.c_lflag & XCASE)) *************** *** 406,409 **** --- 470,474 ---- } /*-------------------------------------------------------------------------*/ + static const char *hosttype[] = { "RT-11", *************** *** 420,425 **** "RSX-11M+", "??13", "??14", "??15", "??16", "??17", ! "Ultrix-32" ! }; static void ct_setup_link(void) --- 485,498 ---- "RSX-11M+", "??13", "??14", "??15", "??16", "??17", ! "","","","","","","","","","","","","","","","","","","","", ! "","","","","","","","","","","","","","","","","","","","", ! "","","","","","","","","","","","","","","","","","","","", ! "","","","","","","","","","","","","","","","","","","","", ! "","","","","","","","","","","","","","","","","","","","", ! "","","","","","","","","","","","","","","","","","","","", ! "","","","","","","","","","","","","","","","","","","","", ! "","","","","","","","","","","","","","","","","","","","", ! "","","","","","","","","","","","","","","","","", ! "Unix-dni"}; static void ct_setup_link(void) *************** *** 427,430 **** --- 500,504 ---- char *local_user; int i; + int loop; unsigned char initsq[31]={0x09,0x00,27,0x00,0x01,0x00,0x01,0x04,0x00, *************** *** 435,441 **** 0x00 }; ! printf("sethost V1.0.3\n"); printf("Connecting to %s\n",nodename); ! if ((sockfd=socket(AF_DECnet,SOCK_SEQPACKET,DNPROTO_NSP)) == -1) { perror("socket"); --- 509,517 ---- 0x00 }; ! if (debug == 2) { printf(" Entered static void ct_setup_link...\n");} ! ! printf("sethost V1.0.4\n"); printf("Connecting to %s\n",nodename); ! if ((sockfd=socket(AF_DECnet,SOCK_SEQPACKET,DNPROTO_NSP)) == -1) { perror("socket"); *************** *** 474,479 **** memcpy(sockaddr.sdn_add.a_addr, np->n_addr,2); ! if (connect(sockfd, (struct sockaddr *)&sockaddr, ! sizeof(sockaddr)) < 0) { perror("socket"); --- 550,555 ---- memcpy(sockaddr.sdn_add.a_addr, np->n_addr,2); ! if (connect(sockfd, (struct sockaddr *)&sockaddr, ! sizeof(sockaddr)) < 0) { perror("socket"); *************** *** 490,495 **** unsigned int len = sizeof(optdata); char *msg; ! ! if (getsockopt(sockfd, DNPROTO_NSP, DSO_DISDATA, &optdata, &len) != -1) { --- 566,574 ---- unsigned int len = sizeof(optdata); char *msg; ! if (debug == 1) ! { ! printf("ct_setup_link no-read trying old way!\n"); /*ed*/ ! } ! if (getsockopt(sockfd, DNPROTO_NSP, DSO_DISDATA, &optdata, &len) != -1) { *************** *** 504,509 **** exit(-1); } ! ! if ((sockfd=socket(AF_DECnet,SOCK_SEQPACKET,DNPROTO_NSP)) == -1) { perror("socket, 2nd time"); --- 583,588 ---- exit(-1); } ! ! if ((sockfd=socket(AF_DECnet,SOCK_SEQPACKET,DNPROTO_NSP)) == -1) { perror("socket, 2nd time"); *************** *** 511,521 **** } sockaddr.sdn_objnum = DNOBJECT_DTERM; ! if (connect(sockfd, (struct sockaddr *)&sockaddr, ! sizeof(sockaddr)) < 0) { perror("connect, 2nd time"); exit(-1); } ! if ( (cnt=read(sockfd,buf,sizeof(buf))) < 0) { --- 590,600 ---- } sockaddr.sdn_objnum = DNOBJECT_DTERM; ! if (connect(sockfd, (struct sockaddr *)&sockaddr, ! sizeof(sockaddr)) < 0) { perror("connect, 2nd time"); exit(-1); } ! if ( (cnt=read(sockfd,buf,sizeof(buf))) < 0) { *************** *** 538,545 **** dterm_bind_reply (); if (buf[4] > 18 || buf[4] < 1) ! printf ("Connected to unknown host type %d.", buf[4]); else ! printf("Connected to %s host.", hosttype[buf[4] - 1]); printf (" Escape Sequence is ^]\n\n\n"); --- 617,624 ---- dterm_bind_reply (); if (buf[4] > 18 || buf[4] < 1) ! printf ("Dterm connection to unknown host type %d.", buf[4]); else ! printf("Dterm connection to %s host.", hosttype[buf[4] - 1]); printf (" Escape Sequence is ^]\n\n\n"); *************** *** 548,558 **** { flavor = CTERM; /* speaking new protocol */ ! if (buf[0] != 0x01) { printf("ct_setup_link: Not bind from host\n"); exit(-1); } ! buf[0]=0x04; /* bind accept flag */ ! if ( (cnt=write(sockfd,buf,6)) < 0) { --- 627,647 ---- { flavor = CTERM; /* speaking new protocol */ ! htype = buf[4]; /*save host type ed*/ ! if (debug == 1) ! { ! printf("ct_setup_link Debug Information:\n"); /*ed*/ ! printf(" ct_setup_link: prot buf[6]: %d\n",buf[6]); /*ed*/ ! printf(" ct_setup_link: osys buf[4]: %d\n",buf[4]); /*ed*/ ! printf(" ct_setup_link: buf[3]: %d\n",buf[3]); /*ed*/ ! printf(" ct_setup_link: buf[2]: %d\n",buf[2]); /*ed*/ ! printf(" ct_setup_link: cmd buf[0]: %d\n",buf[0]); /*ed*/ ! } ! if (buf[0] != 0x01) { printf("ct_setup_link: Not bind from host\n"); exit(-1); } ! buf[0]=0x04; /* bind accept flag */ ! if ( (cnt=write(sockfd,buf,6)) < 0) { *************** *** 569,579 **** if ( (cnt=write(sockfd,initsq,sizeof(initsq))) < 0) { ! printf("ct_setup_link: error sending init sequence\n"); ! exit(-1); } blklen=buf[2] | (buf[3]<<8); bufptr=blklen+4; ! printf("Connected. Escape Sequence is ^]\n\n\n"); } } --- 658,676 ---- if ( (cnt=write(sockfd,initsq,sizeof(initsq))) < 0) { ! if (debug == 1) ! { ! for (loop = 1; loop < 7 ; loop++) ! { if ( (cnt=write(sockfd,initsq,sizeof(initsq))) < 0) ! printf("ct_setup_link: loop initsq error = %d\n",cnt); ! /*ed*/ ! } ! } ! printf("ct_setup_link: error sending init sequence\n"); ! exit(-1); } blklen=buf[2] | (buf[3]<<8); bufptr=blklen+4; ! printf("Cterm connection. Escape Sequence is ^]\n\n\n"); } } *************** *** 583,586 **** --- 680,684 ---- { long savflgs; + if (debug == 2) { printf(" Entered static void ct_init_term...\n");} if ((ttyfd=open("/dev/tty",O_RDWR)) < 0) *************** *** 623,626 **** --- 721,725 ---- char buf[80]; int i,cntx; + if (debug == 2) { printf(" Entered static void ct_preinput_proc...\n");} cntx=read(ttyfd,&buf,80); *************** *** 671,674 **** --- 770,774 ---- char buf[84]; int i,cntx; + if (debug == 2) { printf(" Entered static void rsts_preinput_proc...\n");} cntx=read(ttyfd, &buf[4], 80); *************** *** 702,706 **** /*-------------------------------------------------------------------------*/ static void rsx_preinput_proc(int x) ! { printf ("rsx_preinput_proc NYI\n"); exit(-1); --- 802,806 ---- /*-------------------------------------------------------------------------*/ static void rsx_preinput_proc(int x) ! { if (debug == 2) { printf(" Entered static void rsx_preinput_proc...\n");} printf ("rsx_preinput_proc NYI\n"); exit(-1); *************** *** 712,715 **** --- 812,816 ---- char buf[80]; int i,cntx; + if (debug == 2) { printf(" Entered static void tops_preinput_proc...\n");} cntx=read(ttyfd, &buf, 80); *************** *** 738,744 **** /*-------------------------------------------------------------------------*/ static void ct_print_char(char *c) ! { if (discard) { output_lost=TRUE; return; --- 839,846 ---- /*-------------------------------------------------------------------------*/ static void ct_print_char(char *c) ! { if (debug == 2) { printf(" Entered static void ct_print_char...\n");} if (discard) { + if (debug == 2) { printf(" ct_print_char...discard!!!\n");} /*ed*/ output_lost=TRUE; return; *************** *** 765,769 **** static void ct_echo_prompt(char *c) ! { while (lockflg||hold) ; write(ttyfd,c,1); --- 867,871 ---- static void ct_echo_prompt(char *c) ! { if (debug == 2) { printf(" Entered static void ct_echo_prompt...\n");} while (lockflg||hold) ; write(ttyfd,c,1); *************** *** 775,778 **** --- 877,881 ---- char car; short *p,i,termlen,procnt; + if (debug == 2) { printf(" Entered static void ct_read_req...\n");} bufptr += 1; /* Point to first flag char*/ *************** *** 854,858 **** /*-------------------------------------------------------------------------*/ static void ct_unread_req(void) ! { bufptr += 1; /* Point to unread flag */ --- 957,961 ---- /*-------------------------------------------------------------------------*/ static void ct_unread_req(void) ! { if (debug == 2) { printf(" Entered static void ct_unread_req...\n");} bufptr += 1; /* Point to unread flag */ *************** *** 864,868 **** /*-------------------------------------------------------------------------*/ static void ct_clearinput_req(void) ! { bufptr += 2; rptr=wptr=wrpflg=inpcnt=0; --- 967,971 ---- /*-------------------------------------------------------------------------*/ static void ct_clearinput_req(void) ! { if (debug == 2) { printf(" Entered static void ct_clearinput_req...\n");} bufptr += 2; rptr=wptr=wrpflg=inpcnt=0; *************** *** 875,878 **** --- 978,982 ---- char prefix,postfix,c,lf=0x0A; char msg[8] = {0x09,0x00,0x08,0x00,0x00,0x00,0x00,0x00}; + if (debug == 2) { printf(" Entered static void ct_write_req...\n");} bufptr += 1; /* Skip op code */ *************** *** 957,960 **** --- 1061,1065 ---- short selector,procnt,ouptr; unsigned char outbuf[300]; + if (debug == 2) { printf(" Entered static void ct_readchar_req...\n");} bufptr += 2; /* Skip op code */ *************** *** 974,977 **** --- 1079,1083 ---- if ((selector & 0x300) == 0x000) /* Physical Charac */ { + if (debug == 2) { printf(" ct_readchar_req...Phys char!\n");} switch (selector & 0xFF) { *************** *** 1093,1096 **** --- 1199,1203 ---- if ((selector & 0x300) == 0x100) /* Logical Characteristics*/ { + if (debug == 2) { printf(" ct_readchar_req...Log char!\n");} switch(selector & 0xFF) { *************** *** 1279,1285 **** --- 1386,1394 ---- if ((selector & 0x300) == 0x200) /* Handler Charact */ { + if (debug == 2) { printf(" ct_readchar_req...Han char! %d\n",selector);} switch (selector & 0xFF) { case 0x01: /* IGNORE INPUT */ + if (debug == 2) { printf(" Han char case 1!\n");} p=(void *)&outbuf[ouptr]; set_short(p,0x0201); *************** *** 1291,1294 **** --- 1400,1404 ---- break; case 0x02: /* Character Attributes */ + if (debug == 2) { printf(" Han char case 2!\n");} p=(void *)&outbuf[ouptr]; set_short(p,0x0202); *************** *** 1304,1307 **** --- 1414,1418 ---- break; case 0x03: /* Control-o pass through */ + if (debug == 2) { printf(" Han char case 3!\n");} p=(void *)&outbuf[ouptr]; set_short(p,0x0203); *************** *** 1314,1317 **** --- 1425,1429 ---- case 0x04: /* Raise Input */ + if (debug == 2) { printf(" Han char case 4!\n");} p=(void *)&outbuf[ouptr]; set_short(p,0x0204); *************** *** 1324,1327 **** --- 1436,1440 ---- case 0x05: /* Normal Echo */ + if (debug == 2) { printf(" Han char case 5!\n");} p=(void *)&outbuf[ouptr]; set_short(p,0x0205); *************** *** 1334,1337 **** --- 1447,1451 ---- case 0x06: /* Input Escape Seq Recognition */ + if (debug == 2) { printf(" Han char case 6!\n");} p=(void *)&outbuf[ouptr]; set_short(p,0x0206); *************** *** 1344,1347 **** --- 1458,1462 ---- case 0x07: /* Output Esc Seq Recognition */ + if (debug == 2) { printf(" Han char case 7!\n");} p=(void *)&outbuf[ouptr]; set_short(p,0x0207); *************** *** 1354,1357 **** --- 1469,1473 ---- case 0x08: /* Input count state */ + if (debug == 2) { printf(" Han char case 8!\n");} p=(void *)&outbuf[ouptr]; set_short(p,0x0208); *************** *** 1365,1368 **** --- 1481,1485 ---- case 0x09: /* Auto Prompt */ + if (debug == 2) { printf(" Han char case 9!\n");} p=(void *)&outbuf[ouptr]; set_short(p,0x0209); *************** *** 1375,1378 **** --- 1492,1496 ---- case 0x0A: /* Error processing option */ + if (debug == 2) { printf(" Han char case A!\n");} p=(void *)&outbuf[ouptr]; set_short(p,0x020A); *************** *** 1383,1386 **** --- 1501,1515 ---- bufptr += 2; break; + + case 0x0B: /* Error processing option rsxm+ ed*/ + if (debug == 2) { printf(" Han char case B!\n");} + p=(void *)&outbuf[ouptr]; + set_short(p,0x020B); + ouptr += 2; + outbuf[ouptr]=han_char.error_processing; + ouptr += 1; + procnt += 2; + bufptr += 2; + break; } } *************** *** 1401,1404 **** --- 1530,1534 ---- short *p; short selector, procnt; + if (debug == 2) { printf(" Entered static void ct_writechar_req...\n");} bufptr += 2; /* Skip op code */ *************** *** 1497,1500 **** --- 1627,1631 ---- unsigned char msg[8] = {0x09,0x00,0x04,0x00,0x0D,0x00,0x00,0x00}; short *p = (void *)&msg[4]; + if (debug == 2) { printf(" Entered static void ct_checkinput_req...\n");} set_short(p, aheadcnt+inpcnt); *************** *** 1512,1515 **** --- 1643,1647 ---- int retval; long numbytes; + if (debug == 2) { printf(" Entered static void ct_read_pkt...\n");} do { *************** *** 1550,1554 **** { int data_cnt; ! if (buf[1] + (buf[2] << 8) != cnt) { --- 1682,1687 ---- { int data_cnt; ! if (debug == 2) { printf(" Entered static void proc_rsts_pkt...\n");} ! if (buf[1] + (buf[2] << 8) != cnt) { *************** *** 1577,1581 **** /*-------------------------------------------------------------------------*/ static void proc_rsx_pkt(void) ! { printf ("not yet implemented -- proc_rsx_pkt\n"); exit(-1); --- 1710,1714 ---- /*-------------------------------------------------------------------------*/ static void proc_rsx_pkt(void) ! { if (debug == 2) { printf(" Entered static void proc_rsx_pkt...\n");} printf ("not yet implemented -- proc_rsx_pkt\n"); exit(-1); *************** *** 1583,1587 **** /*-------------------------------------------------------------------------*/ static void proc_tops_pkt(void) ! { /* message is just plain terminal output data */ write(ttyfd, buf, cnt); --- 1716,1720 ---- /*-------------------------------------------------------------------------*/ static void proc_tops_pkt(void) ! { if (debug == 2) { printf(" Entered static void proc_tops_pkt...\n");} /* message is just plain terminal output data */ write(ttyfd, buf, cnt); *************** *** 1590,1594 **** /*-------------------------------------------------------------------------*/ static void proc_cterm_pkt (void) ! { blklen=buf[bufptr] | (buf[bufptr+1]<<8); bufptr += 2; --- 1723,1728 ---- /*-------------------------------------------------------------------------*/ static void proc_cterm_pkt (void) ! { if (debug == 2) { printf(" Entered static void proc_cterm_pkt...\n");} ! blklen=buf[bufptr] | (buf[bufptr+1]<<8); bufptr += 2; *************** *** 1622,1626 **** /*-------------------------------------------------------------------------*/ static void ct_proc_pkt(void) ! { if (cnt==bufptr) ct_read_pkt(); /* Get next pkt */ while (!unbind) --- 1756,1761 ---- /*-------------------------------------------------------------------------*/ static void ct_proc_pkt(void) ! { if (debug == 2) { printf(" Entered static void ct_proc_pkt...\n");} ! if (cnt==bufptr) ct_read_pkt(); /* Get next pkt */ while (!unbind) *************** *** 1656,1667 **** int verbosity; ! int debug = 0; char log_char = 'l'; char opt; ! // Deal with command-line arguments. opterr = 0; optind = 0; ! while ((opt=getopt(argc,argv,"?Vhe:")) != EOF) { switch(opt) --- 1791,1803 ---- int verbosity; ! /*int debug = 0;*/ char log_char = 'l'; char opt; ! if (debug == 2) { printf(" Entered int main...\n");} ! // Deal with command-line arguments. opterr = 0; optind = 0; ! while ((opt=getopt(argc,argv,"?Vhdte:")) != EOF) { switch(opt) *************** *** 1684,1687 **** --- 1820,1830 ---- break; + case 'd': + debug = 1; + break; + + case 't': + debug = 2; + break; } } *************** *** 1709,1712 **** --- 1852,1859 ---- sigemptyset(&ss); + if (debug == 1) + { + printf("Connection to %d flavor",flavor); /*ed*/ + } switch (flavor) { |
From: Patrick C. <pa...@us...> - 2002-02-13 16:59:16
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv19150 Modified Files: connection.cc lloginsession.cc server.cc services.cc connection.h lat.h server.h Log Message: - Moved some common "make_session" code into it's own method in connection.cc - Remove spurious "Queued" messages and fix the contents on big-endian machines - Store DS90L services in a dummy service table entry called "" so they don't get mixed up with real ones. This forces DS90L uses to create the ports with no service name which is probably a good thing anyway. - Document the above in latcp.8 - Fix multiple use of queued connections I broke in 1.11 - Removed some more trailing blanks. Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -r1.37 -r1.38 *** connection.cc 11 Feb 2002 14:09:38 -0000 1.37 --- connection.cc 13 Feb 2002 16:59:12 -0000 1.38 *************** *** 943,948 **** } ! int LATConnection::create_llogin_session(int fd, char *service, char *port, char *localport, ! char *password) { // Create an lloginSession --- 943,948 ---- } ! int LATConnection::create_llogin_session(int fd, const char *service, const char *port, const char *localport, ! const char *password) { // Create an lloginSession *************** *** 950,955 **** lloginSession *newsession = new lloginSession(*this, 0, newsessionnum, ! localport, fd); ! if (newsession->new_session(remnode, service, port, password, 0) == -1) { delete newsession; --- 950,955 ---- lloginSession *newsession = new lloginSession(*this, 0, newsessionnum, ! (char *)localport, fd); ! if (newsession->new_session((unsigned char *)remnode, (char *)service, (char *)port, (char *)password, 0) == -1) { delete newsession; Index: lloginsession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/lloginsession.cc,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** lloginsession.cc 11 Feb 2002 14:09:38 -0000 1.11 --- lloginsession.cc 13 Feb 2002 16:59:13 -0000 1.12 *************** *** 36,39 **** --- 36,40 ---- #include "lloginsession.h" #include "lat_messages.h" + #include "dn_endian.h" lloginSession::lloginSession(class LATConnection &p, *************** *** 180,188 **** int len; ! 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; } --- 181,192 ---- int len; ! if (entry->max_que_pos != 0) ! { ! len = snprintf(buffer, sizeof(buffer), "LAT: You are queued for %s, position %d\n", ! node, dn_ntohs(entry->max_que_pos)); ! write(master_fd, buffer, len); ! have_been_queued = true; ! } } *************** *** 191,195 **** void lloginSession::start_port() { ! if (have_been_queued) write(master_fd, "LAT: Connected\n", 15); } --- 195,200 ---- void lloginSession::start_port() { ! if (have_been_queued) ! write(master_fd, "LAT: Connected\n", 15); } Index: server.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.cc,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -r1.53 -r1.54 *** server.cc 13 Feb 2002 09:46:14 -0000 1.53 --- server.cc 13 Feb 2002 16:59:13 -0000 1.54 *************** *** 111,117 **** ! // Send ENQUIRY for a service - mainly needed for DS90L servers that // don't advertise. ! void LATServer::send_enq(unsigned char *service) { unsigned char packet[1600]; --- 111,117 ---- ! // Send ENQUIRY for a node - mainly needed for DS90L servers that // don't advertise. ! void LATServer::send_enq(unsigned char *node) { unsigned char packet[1600]; *************** *** 129,133 **** enqmsg->retrans_timer = 2; ! add_string(packet, &ptr, service); packet[ptr++] = 1; /* Length of group data */ packet[ptr++] = 1; /* Group mask */ --- 129,133 ---- enqmsg->retrans_timer = 2; ! add_string(packet, &ptr, node); packet[ptr++] = 1; /* Length of group data */ packet[ptr++] = 1; /* Group mask */ *************** *** 755,765 **** if (entry->length == 0) break; - if (connections[entry->request_id]) - connections[entry->request_id]->got_status(node, entry); - ptr += sizeof(LAT_StatusEntry); ! ptr += inbuf[ptr]+1; // Past service name ptr += inbuf[ptr]+1; // Past port name ptr += inbuf[ptr]+1; // Past service description } } --- 755,766 ---- if (entry->length == 0) break; ptr += sizeof(LAT_StatusEntry); ! get_string(inbuf, &ptr, node); // Service name ptr += inbuf[ptr]+1; // Past port name ptr += inbuf[ptr]+1; // Past service description + + if (connections[entry->request_id]) + connections[entry->request_id]->got_status(node, entry); + } } *************** *** 969,978 **** } ! // Got a reply from a DS90L - add it to the services list void LATServer::got_enqreply(unsigned char *buf, int len, int interface, unsigned char *macaddr) { int ptr = 23; ! /* Don't know the format of this packet before this... */ ptr += buf[ptr++]; /* Skip group codes; */ --- 970,979 ---- } ! // Got a reply from a DS90L - add it to the services list in a dummy service void LATServer::got_enqreply(unsigned char *buf, int len, int interface, unsigned char *macaddr) { int ptr = 23; ! // Don't know the format of this packet before this... ptr += buf[ptr++]; /* Skip group codes; */ *************** *** 981,989 **** get_string(buf, &ptr, nodename); ! /* Add it as a service. This is, technically, wrong but it will ! do for the mo. */ LATServices::Instance()->add_service(std::string((char*)nodename), ! std::string((char*)nodename), ! std::string((char*)"DS90L"), 0, interface, macaddr); --- 982,989 ---- get_string(buf, &ptr, nodename); ! // Add it to the dummy service. LATServices::Instance()->add_service(std::string((char*)nodename), ! std::string((char*)""), // Dummy service name ! std::string((char*)"Dummy Service for DS90L servers"), 0, interface, macaddr); *************** *** 1327,1330 **** --- 1327,1331 ---- if (strcmp(p->get_devname().c_str(), name) == 0) { + p->close_and_delete(); portlist.erase(p); return true; *************** *** 1392,1400 **** } ! ! int LATServer::make_llogin_connection(int fd, char *service, char *rnode, char *port, ! char *localport, char *password, bool queued) { - int ret; unsigned char macaddr[6]; std::string servicenode; --- 1393,1400 ---- } ! // Generic make_connection code for llogin & port sessions. ! int LATServer::make_connection(int fd, const char *service, const char *rnode, const char *port, ! const char *localport, const char *password, bool queued) { unsigned char macaddr[6]; std::string servicenode; *************** *** 1430,1435 **** } ! /* Look for a connection that's already in use for this node */ ! int connid = find_connection_by_node(node); if (connid == -1) { --- 1430,1438 ---- } ! // Look for a connection that's already in use for this node, unless we ! // are queued in which case we need to allocate a new connection for ! // initiating the connection and receiving status requests on. ! int connid = -1; ! if (!queued) connid = find_connection_by_node(node); if (connid == -1) { *************** *** 1444,1453 **** false); } ! if (connid == -1) ! { ! return -1; // Failed ! } debuglog(("lloginSession for %s has connid %d\n", service, connid)); ret = connections[connid]->create_llogin_session(fd, service, port, localport, password); --- 1447,1467 ---- false); } ! ! return connid; ! } ! ! ! int LATServer::make_llogin_connection(int fd, const char *service, const char *rnode, const char *port, ! const char *localport, const char *password, bool queued) ! { ! int ret; ! int connid; debuglog(("lloginSession for %s has connid %d\n", service, connid)); + + connid = make_connection(fd, service, rnode, port, localport, password, queued); + if (connid < 0) + return connid; + ret = connections[connid]->create_llogin_session(fd, service, port, localport, password); *************** *** 1471,1529 **** { int ret; ! unsigned char macaddr[6]; ! std::string servicenode; ! int this_int; ! char node[255]; ! // Take a local copy of the node so we can overwrite it. ! strcpy(node, rnode); ! ! // If no node was specified then use the highest rated one ! if (node[0] == '\0') ! { ! if (!LATServices::Instance()->get_highest(std::string((char*)service), ! servicenode, macaddr, ! &this_int)) ! { ! debuglog(("Can't find service %s\n", service)); ! return -2; // Never eard of it! ! } ! strcpy((char *)node, servicenode.c_str()); ! } ! else ! { ! // Try to find the node ! if (!LATServices::Instance()->get_node(std::string((char*)service), ! std::string((char*)node), macaddr, ! &this_int)) ! { ! debuglog(("Can't find node %s in service\n", node, service)); ! ! return -2; ! } ! } ! ! /* Look for a connection that's already in use for this node */ ! int connid = find_connection_by_node(node); ! if (connid == -1) ! { ! // None: create a new one ! connid = get_next_connection_number(); ! connections[connid] = new LATConnection(connid, ! (char *)service, ! (char *)port, ! (char *)localport, ! (char *)node, ! queued, ! false); ! } ! if (connid == -1) ! { ! return -1; // Failed ! } debuglog(("localport for %s has connid %d\n", service, connid)); - // TODO: Different call into Connection() ret = connections[connid]->create_localport_session(fd, lport, service, port, localport, password); --- 1485,1496 ---- { int ret; ! int connid; ! connid = make_connection(fd, service, rnode, port, localport, password, queued); ! if (connid < 0) ! return connid; debuglog(("localport for %s has connid %d\n", service, connid)); ret = connections[connid]->create_localport_session(fd, lport, service, port, localport, password); Index: services.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/services.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** services.cc 3 Jan 2002 08:46:55 -0000 1.9 --- services.cc 13 Feb 2002 16:59:13 -0000 1.10 *************** *** 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 *************** *** 34,38 **** debuglog(("Got service. Node: %s, service %s, rating: %d\n", node.c_str(), service.c_str(), rating)); ! std::map<std::string, serviceinfo, std::less<std::string> >::iterator test = servicelist.find(service); if (test == servicelist.end()) --- 34,38 ---- debuglog(("Got service. Node: %s, service %s, rating: %d\n", node.c_str(), service.c_str(), rating)); ! std::map<std::string, serviceinfo, std::less<std::string> >::iterator test = servicelist.find(service); if (test == servicelist.end()) *************** *** 48,52 **** // Return the highest rated node providing a named service ! bool LATServices::get_highest(const std::string &service, std::string &node, unsigned char *macaddr, int *interface) { --- 48,52 ---- // Return the highest rated node providing a named service ! bool LATServices::get_highest(const std::string &service, std::string &node, unsigned char *macaddr, int *interface) { *************** *** 65,69 **** std::string highest_node; const unsigned char *highest_macaddr = NULL; ! std::map<std::string, nodeinfo, std::less<std::string> >::iterator i; for (i=nodes.begin(); i != nodes.end(); i++) --- 65,69 ---- std::string highest_node; const unsigned char *highest_macaddr = NULL; ! std::map<std::string, nodeinfo, std::less<std::string> >::iterator i; for (i=nodes.begin(); i != nodes.end(); i++) *************** *** 94,98 **** // Return the node macaddress if the node provides this service ! bool LATServices::get_node(const std::string &service, const std::string &node, unsigned char *macaddr, int *interface) { --- 94,98 ---- // Return the node macaddress if the node provides this service ! bool LATServices::get_node(const std::string &service, const std::string &node, unsigned char *macaddr, int *interface) { *************** *** 129,137 **** bool removed = false; std::map<std::string, serviceinfo, std::less<std::string> >::iterator s(servicelist.begin()); ! for (; s != servicelist.end(); s++) { if (servicelist[s->first].remove_node(node)) ! removed=true; } return removed; --- 129,137 ---- bool removed = false; std::map<std::string, serviceinfo, std::less<std::string> >::iterator s(servicelist.begin()); ! for (; s != servicelist.end(); s++) { if (servicelist[s->first].remove_node(node)) ! removed=true; } return removed; *************** *** 144,159 **** if (test != nodes.end()) { ! nodes[test->first].set_available(false); } ! return false; } ! // Return true if the service is available. // This is the case if one node offering that service is available bool LATServices::serviceinfo::is_available() ! { bool avail = true; std::map<std::string, nodeinfo, std::less<std::string> >::iterator n(nodes.begin()); ! for (; n != nodes.end(); n++) { --- 144,159 ---- if (test != nodes.end()) { ! nodes[test->first].set_available(false); } ! return false; } ! // Return true if the service is available. // This is the case if one node offering that service is available bool LATServices::serviceinfo::is_available() ! { bool avail = true; std::map<std::string, nodeinfo, std::less<std::string> >::iterator n(nodes.begin()); ! for (; n != nodes.end(); n++) { *************** *** 167,177 **** { std::map<std::string, nodeinfo, std::less<std::string> >::iterator n(nodes.begin()); ! output << "Node Name Status Rating Identification" << std::endl; for (; n != nodes.end(); n++) { ! output << std::setw(28 - n->first.length()) << n->first << ! (nodes[n->first].is_available()?"Reachable ":"Unreachable") << " " << ! std::setw(4) << nodes[n->first].get_rating() << " " << nodes[n->first].get_ident() << std::endl; } --- 167,177 ---- { std::map<std::string, nodeinfo, std::less<std::string> >::iterator n(nodes.begin()); ! output << "Node Name Status Rating Identification" << std::endl; for (; n != nodes.end(); n++) { ! output << std::setw(28 - n->first.length()) << n->first << ! (nodes[n->first].is_available()?"Reachable ":"Unreachable") << " " << ! std::setw(4) << nodes[n->first].get_rating() << " " << nodes[n->first].get_ident() << std::endl; } *************** *** 185,203 **** for (; s != servicelist.end(); s++) { ! if (verbose) ! { ! output << std::endl; ! output << "Service Name: " << s->first << std::endl; ! output << "Service Status: " << (servicelist[s->first].is_available()?"Available ":"Unavailable") << " " << std::endl; ! output << "Service Ident: " << servicelist[s->first].get_ident() << std::endl << std::endl; ! servicelist[s->first].list_service(output); ! output << "--------------------------------------------------------------------------------" << std::endl; ! ! } ! else { ! output << std::setw(28 - s->first.length()) << s->first << ! (servicelist[s->first].is_available()?"Available ":"Unavailable") << " " << ! servicelist[s->first].get_ident() << std::endl; } --- 185,207 ---- for (; s != servicelist.end(); s++) { ! // Skip dummy service ! if (s->first != "") { ! if (verbose) ! { ! output << std::endl; ! output << "Service Name: " << s->first << std::endl; ! output << "Service Status: " << (servicelist[s->first].is_available()?"Available ":"Unavailable") << " " << std::endl; ! output << "Service Ident: " << servicelist[s->first].get_ident() << std::endl << std::endl; ! servicelist[s->first].list_service(output); ! output << "--------------------------------------------------------------------------------" << std::endl; ! ! } ! else ! { ! output << std::setw(28 - s->first.length()) << s->first << ! (servicelist[s->first].is_available()?"Available ":"Unavailable") << " " << ! servicelist[s->first].get_ident() << std::endl; ! } } Index: connection.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** connection.h 8 Feb 2002 15:07:30 -0000 1.20 --- connection.h 13 Feb 2002 16:59:13 -0000 1.21 *************** *** 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, --- 42,46 ---- bool queued, bool clean); int connect(class ClientSession *); ! int create_llogin_session(int, const char *service, const char *port, const char *localport, const char *password); int create_localport_session(int, class LocalPort *, const char *service, const char *port, const char *localport, Index: lat.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/lat.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** lat.h 11 Feb 2002 14:09:38 -0000 1.9 --- lat.h 13 Feb 2002 16:59:13 -0000 1.10 *************** *** 173,177 **** unsigned short min_que_pos __attribute__ ((packed)); unsigned short max_que_pos __attribute__ ((packed)); ! // ASCIC Service Name (usually NUL) // ASCIC Port Name // ASCIC Service description --- 173,177 ---- unsigned short min_que_pos __attribute__ ((packed)); unsigned short max_que_pos __attribute__ ((packed)); ! // ASCIC Service Name // ASCIC Port Name // ASCIC Service description Index: server.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -r1.33 -r1.34 *** server.h 11 Feb 2002 14:09:38 -0000 1.33 --- server.h 13 Feb 2002 16:59:13 -0000 1.34 *************** *** 103,106 **** --- 103,107 ---- void print_bitmap(std::ostrstream &, bool, unsigned char *bitmap); void tidy_dev_directory(); + int make_connection(int fd, const char *, const char *, const char *, const char *, const char *, bool); static void alarm_signal(int sig); *************** *** 274,278 **** 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); --- 275,279 ---- unsigned char *, unsigned char *, bool, bool, unsigned char *); ! int make_llogin_connection(int fd, const char *, const char *, const char *, const char *, const char *, bool); int make_port_connection(int fd, LocalPort *, const char *, const char *, const char *, const char *, const char *, bool); |
From: Patrick C. <pa...@us...> - 2002-02-13 16:50:13
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv16795 Modified Files: localport.cc Log Message: Decided close_and_delete() is better called from server.cc after all. Index: localport.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/localport.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** localport.cc 13 Feb 2002 08:54:13 -0000 1.6 --- localport.cc 13 Feb 2002 16:50:08 -0000 1.7 *************** *** 81,87 **** debuglog(("openpty: master_fd=%d, slave_fd=%d\n", master_fd, slave_fd)); ! // Send a request for the service if we are queued so that // by the time the user comes to use this port, we know about it. ! LATServer::Instance()->send_enq((unsigned char *)remnode.c_str()); // Set terminal characteristics --- 81,89 ---- debuglog(("openpty: master_fd=%d, slave_fd=%d\n", master_fd, slave_fd)); ! // For ports with no service name (ie on DS90L servers) ! // send a request for the service if we are queued so that // by the time the user comes to use this port, we know about it. ! if (service == "") ! LATServer::Instance()->send_enq((unsigned char *)remnode.c_str()); // Set terminal characteristics *************** *** 129,133 **** LocalPort::~LocalPort() { - close_and_delete(); } --- 131,134 ---- |
From: Patrick C. <pa...@us...> - 2002-02-13 16:38:44
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv13360 Modified Files: session.h session.cc Log Message: Missed a tcflow(off) when I added them last time. Restrict reads to 250 bytes for DS200s benefit Index: session.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/session.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** session.h 3 Jan 2002 08:46:56 -0000 1.9 --- session.h 13 Feb 2002 16:38:40 -0000 1.10 *************** *** 9,13 **** remote_session(remid), local_session(localid), ! max_read_size(255), clean(_clean), credit(0), --- 9,13 ---- remote_session(remid), local_session(localid), ! max_read_size(250), clean(_clean), credit(0), Index: session.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/session.cc,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** session.cc 3 Jan 2002 08:46:55 -0000 1.29 --- session.cc 13 Feb 2002 16:38:40 -0000 1.30 *************** *** 124,127 **** --- 124,128 ---- LATServer::Instance()->set_fd_state(master_fd, true); stopped = true; + tcflow(master_fd, TCOOFF); return 0; // Not allowed! } *************** *** 138,141 **** --- 139,144 ---- buf[10] = tmp; } + #else + debuglog(("Session %d From PTY(%d)\n", local_session, msglen)); #endif |
From: Patrick C. <pa...@us...> - 2002-02-13 09:46:17
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv18577 Modified Files: server.cc Log Message: No, we don't need the p->close_and_delete() as it's better in the destructor of LocalPort. Index: server.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.cc,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -r1.52 -r1.53 *** server.cc 13 Feb 2002 09:40:21 -0000 1.52 --- server.cc 13 Feb 2002 09:46:14 -0000 1.53 *************** *** 1327,1331 **** if (strcmp(p->get_devname().c_str(), name) == 0) { - p->close_and_delete(); portlist.erase(p); return true; --- 1327,1330 ---- |
From: Patrick C. <pa...@us...> - 2002-02-13 09:40:25
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv17163 Modified Files: latcpcircuit.cc server.cc Log Message: Fixes from Denis Komissaro: Fail creation of /dev/lat port if it already exists. Delete port on latcp -D -p (again???, hmm check this). Index: latcpcircuit.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcpcircuit.cc,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** latcpcircuit.cc 8 Feb 2002 15:07:30 -0000 1.19 --- latcpcircuit.cc 13 Feb 2002 09:40:21 -0000 1.20 *************** *** 278,282 **** get_string((unsigned char*)cmdbuf, &ptr, name); ! debuglog(("latcp: del service: %s\n", name)); if (LATServer::Instance()->remove_port((char*)name)) --- 278,282 ---- get_string((unsigned char*)cmdbuf, &ptr, name); ! debuglog(("latcp: del port: %s\n", name)); if (LATServer::Instance()->remove_port((char*)name)) *************** *** 339,342 **** --- 339,343 ---- unsigned char password[255]; int ptr=0; + int res=0; get_string((unsigned char*)cmdbuf, &ptr, service); *************** *** 351,355 **** service, remport, localport)); ! if (LATServer::Instance()->create_local_port(service, remport, localport, --- 352,360 ---- service, remport, localport)); ! // ! // MSC DVK 12-Feb-2002, more verbose error report to user. ! // ! ! res = LATServer::Instance()->create_local_port(service, remport, localport, *************** *** 357,368 **** queued, clean, ! password) < 0) ! { ! debuglog(("sending failure back to LATCP\n")); ! send_reply(LATCP_ERRORMSG, "Error creating client service, service unknown", -1); ! } ! else ! { ! send_reply(LATCP_ACK, "", -1); } } --- 362,373 ---- queued, clean, ! password); ! switch (res) { ! case 1: ! send_reply(LATCP_ERRORMSG, "Local port (tty) already in use", -1); ! break; ! case 0: ! send_reply(LATCP_ACK, "", -1); // all OK ! break; } } Index: server.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.cc,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -r1.51 -r1.52 *** server.cc 12 Feb 2002 16:55:51 -0000 1.51 --- server.cc 13 Feb 2002 09:40:21 -0000 1.52 *************** *** 1322,1326 **** // Search for it. - std::list<LocalPort>::iterator p(portlist.begin()); for (; p != portlist.end(); p++) --- 1322,1325 ---- *************** *** 1328,1331 **** --- 1327,1331 ---- if (strcmp(p->get_devname().c_str(), name) == 0) { + p->close_and_delete(); portlist.erase(p); return true; *************** *** 1546,1554 **** { 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 // the STL containers hold actual objects rather then pointers - std::list<LocalPort>::iterator p(portlist.begin()); for (; p != portlist.end(); p++) --- 1546,1564 ---- { debuglog(("Server::create_local_port: %s\n", devname)); + + // Don't create it if it already exists. + std::list<LocalPort>::iterator i(portlist.begin()); + for (; i != portlist.end(); i++) + { + if (strcmp(i->get_devname().c_str(), (char *)devname) == 0) + { + return 1; // already in use + } + } + 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 // the STL containers hold actual objects rather then pointers std::list<LocalPort>::iterator p(portlist.begin()); for (; p != portlist.end(); p++) *************** *** 1557,1560 **** --- 1567,1571 ---- { p->init_port(); + break; } } |
From: Patrick C. <pa...@us...> - 2002-02-13 08:54:16
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv5639 Modified Files: localport.cc Log Message: Really delete port on latcp -D -p Index: localport.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/localport.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** localport.cc 11 Feb 2002 16:39:34 -0000 1.5 --- localport.cc 13 Feb 2002 08:54:13 -0000 1.6 *************** *** 129,132 **** --- 129,133 ---- LocalPort::~LocalPort() { + close_and_delete(); } |
From: Patrick C. <pa...@us...> - 2002-02-12 16:55:55
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv5303 Modified Files: server.cc Log Message: Fix a couple of comment typos "GRILLOCKS" is not a good name for a reply node Fix endian mistake in send_enq Index: server.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.cc,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -r1.50 -r1.51 *** server.cc 11 Feb 2002 14:09:38 -0000 1.50 --- server.cc 12 Feb 2002 16:55:51 -0000 1.51 *************** *** 125,129 **** enqmsg->latver = 5; enqmsg->latver_eco = 2; ! enqmsg->mtu = 1500; enqmsg->id = 1; /* Something here */ enqmsg->retrans_timer = 2; --- 125,129 ---- enqmsg->latver = 5; enqmsg->latver_eco = 2; ! enqmsg->mtu = dn_htons(1500); enqmsg->id = 1; /* Something here */ enqmsg->retrans_timer = 2; *************** *** 133,137 **** packet[ptr++] = 1; /* Group mask */ ! add_string(packet, &ptr, (unsigned char*)"GRILLOCKS"); unsigned char addr[6]; --- 133,137 ---- packet[ptr++] = 1; /* Group mask */ ! add_string(packet, &ptr, local_name); unsigned char addr[6]; *************** *** 155,160 **** } } - - } --- 155,158 ---- *************** *** 906,910 **** tidy_dev_directory(); ! // Saave these two for any newly added services rating = _rating; static_rating = _static_rating; --- 904,908 ---- tidy_dev_directory(); ! // Save these two for any newly added services rating = _rating; static_rating = _static_rating; *************** *** 976,980 **** int ptr = 23; ! /* Dont know the format of this packet before this... */ ptr += buf[ptr++]; /* Skip group codes; */ --- 974,978 ---- int ptr = 23; ! /* Don't know the format of this packet before this... */ ptr += buf[ptr++]; /* Skip group codes; */ |
From: Patrick C. <pa...@us...> - 2002-02-12 13:48:17
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv3181 Modified Files: README TODO INSTALL Makefile rpm.spec Added Files: lat.html Log Message: Documentation updates. --- NEW FILE: lat.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="Author" content="Patrick Caulfield"> <title>DECnet for Linux - LAT</title> </head> <body text="#000000" bgcolor="#ffffff" link="#0000ef" vlink="#51188e" alink="#ff0000"> <table cols="2" width="100%" nosave=""> <tbody> <tr nosave=""> <td width="100" nosave=""><img src="tramp-penguin.jpg" height="200" width="100" ALT="tramp"></td> <td nosave=""><b><font size="+3">DECnet for Linux</font></b> <p><font size="+3">A project to provide DECnet phase IV connectivity forLinux</font><br> </p> <p><b><font color="#cc0000"><font size="+3">LAT</font></font></b><br> </p> </td> </tr> </tbody> </table> <h1>LAT</h1> This is a quick guide to using LAT on Linux systems. I am assuming that you already have the latd package installed and that the latcp command is on root's PATH. All the terminal server examples are for the (very obsolete) DECserver 200 but the syntax is similar for other models. <p>In this document I refer to <b>latd</b> as the daemon that is running in the background accepting incoming connections and marshalling outgoing ones, <b>latcp</b> is the LAT control program which is the user interface to latd. </p> <p>The latcp commands are based on those used in Compaq Tru64 Unix, so if you are familiar with that then this should all look very familiar to you. However, they are <i>not</i> identical to Tru64 so you should still at least skim this document or the man page for latcp.</p> <p>The examples here are for latd 1.12. Not all the features are available in earlier versions. </p> <p></p> <h1>Starting and stopping it</h1> <tt><b>latcp -s</b></tt> starts the lat daemon.<br> <tt><b>latcp -h</b></tt> stops the daemon. <p>By default (ie if you haven't customised the startup script) latd will advertise a service which is the hostname of your Linux system. This means that any users that have terminals connected to a terminal service will be able to connect to your system by typing the appropriate connect command to the terminal server. On a DECserver 200 this would be "CONNECT LINUX" if your machine's host name is "linux". Of course, if the user does not have a username on the system they will not be able to get past the login prompt. When latcp starts the daemon it runs a <i>startup script</i> called <tt><b> /etc/latd.conf</b></tt> which is a conventional shell script. If you want to customise the way LAT works then this is the place to do it. The rest of this document explains the latcp commands that you can use to customise LAT and it is normal to put these commands in the startup script so that they take effect each time the system is rebooted.</p> By default latd listens on all ethernet interfaces on your system. If you want to restrict this you can specify as many interfaces as you like on the latcp command line eg: <samp><b>latcp -s -i eth1 -i eth2</b></samp>. It is not currently possible to change this in the startup script.<br> <p>When you stop latd all users are instantly disconnected. They will get no warning and work will not be saved.</p> <p></p> <h1>Service names</h1> latd can advertise many services, not just one for the host name. So (for example) you could add a new service called LINUX on all linux machines running latd and then users can connect to LINUX and they will be attached to the server with the lowest load average. <p>To add such a service use the command <tt><b>latcp -A -a LINUX</b></tt> . This tells latd to advertise the new service along with the default one using the same rating.</p> <p>To remove this service use the command <tt><b>latcp -D -a LINUX</b></tt> .</p> <p>Services have an optional description associated with them which can show up on some terminal servers if the user issues a SHOW SERVICE command. The description is added to the service with the -i switch. eg:<tt><b>latcp -A -a LINUX -i "Linux login service"</b></tt><br> Note that the description must be enclosed in quotes if it contains spaces. To change the description of an existing service use the following command:<br> <tt><b>latcp -i "Linux is wonderful" -a LINUX</b></tt><br> </p> <p></p> <h1>Service ratings</h1> Every advertised service has a <i>rating</i> associated with it. This rating is used in the terminal servers' load balancing algorithm to determine which node to connect to when more than one system advertises the same service name. By default, services advertised by latd have <i>dynamic</i> ratings, that is they vary according to the load on the system. The value you specify on the latcp command line is a maximum, this value is divided by the current load average plus one each time the service is advertised on the LAN. <p>So, if you create a service with rating of 100 using the following command:<br> <tt><b>latcp -A -a LINUX -r 100</b></tt><br> and the load average is 1.00, then the advertised rating will be 50. If you have several machines advertising the the same service then, to achieve effective load balancing, the rating specified on the command-line should reflect the relative power of the machines offering that service.</p> <p>In addition, ratings can be <i>static</i>. A static rating does not vary with the system load average. If you create a service with the following command:<br> <tt><b>latcp -A -a LINUX -r 100 -s</b></tt><br> Then the rating will always be 100 regardless of how busy the system is.</p> <p></p> <h1>Reverse LAT</h1> The "normal" use of LAT is to allow a terminal, connected to a terminal server to log into a computer. "Reverse-LAT" goes the other way, the computer makes a connection to a port on the terminal server. This has a number of uses: the most popular are<br> <ul> <li>Connect a printer to a terminal server port and let computers print to that printer by mappinga device on the computer to the terminal server port and</li> <li>Connect a computer console to a terminal server so that the computer can be remotelymanaged from another computer.</li> <li>Connect a modem to a terminal server port and allow users to dial in, or dial out.<br> </li> </ul> To do this you first need to create a service on the terminal server. How to do this varies on the model of terminal server you have so consult the documentation for your device. The command for a DECserver 200 is as follows:<br> <tt><b>DEFINE SERVICE MYVAX PORT 4</b></tt><br> This creates a service called MYVAX which is associated with port 4 on the terminal server. Note,you may also have to set the port characteristics to match those of the printer and set the access type to "Remote". Now, assuming you have connected the serial console of your VAX to port 4 of the terminal server and the server is called DS200, you can issue the following command on the linux machine:<br> <tt><b>latcp -A -p /dev/lat/myvax -Hds200 -Vmyvax</b></tt><br> If you now connect a terminal emulator program (say minicom, seyon or microcom) to /dev/lat/myvax you can log in to the console of the VAX and issue commands as if the terminal was local. If it doesn't work then there are a few things to check:<br> <ul> <li>The port is set correctly for remote connections, and that the baud rate and flow-control attributes are set correctly.</li> <li>That nobody else is connected to that service. On a DECServer 200 the command SHOW USERS will help here.</li> <li>That the service has been advertised on the LAN. Services are only broadcast on the LAN every 30 or 60 seconds (depending on the configuration) so you may have to wait that long before the service is seen by latd. Use the command <tt><b>latcp -d -l</b></tt> to see which services are known to latd.</li> <li>That the group numbers are set correctly, see later for a description of groups</li> <li>That you have correctly specified service name (and perhaps the host name) on the latcp command line.<br> </li> </ul> <p>In the case of a printer that is shared by several machines you may want to make it a queued connection. This means that if the printer is busy, any other machine that tries to connect to it will be forced to wait until it is ready. To do this set the port to be queued on the terminal server and specify the reverse-lat port to be queued by adding -Q to the command line as follows:<br> <tt><b>latcp -A -p /dev/lat/printer -Hds200 -Vprinter -Q</b></tt><br> </p> <p>To allow users other than root to connect to reverse-LAT services you must create a group in /etc/groups called "lat" and add reverse-LAT users to that group. See your distribution's documentation for managing groups. Not that this group does not affect normal, "forward" use for LAT for those users.</p> <p>To send a BREAK character to the remote node press ^@. Normally this is shifted to you actually have to press Ctrl-Shift-' on a British keyboard for example.</p> <p>To use "printer" ports on a DECserver 90L you must make the port queued because that device does not support reverse LAT. <h1>Groups</h1> Groups on LAT are a method of restricting the visible services to a manageable subset. They are<i>not</i> a security feature, merely a method of making a large number of services more manageable. <p>When a service is advertised on the LAN it can have any number of groups associated with it. A group is a number from 0 to 255. By default all services are in group 0. On the terminal server you can restrict the group numbers that it will listen for services on. So, for example, a terminal server inthe sales department could have only group 10 enabled, a terminal service in the production department could have only group 20 enabled. The host machines providing these services would advertise sales service in group 10 and production services in group 20. The computer department servers would probably have all the groups enabled so that they could connect to all the services.</p> <p>Because latd is both a client and a server it has two sets of group codes. One set (that manipulated by the -G and -g switches) determines the group numbers that the advertised services use. So, if we execute the following latcp commands:<br> <tt><b>latcp -G 10<br> latcp -A -a LINUX -i "Linux login service"</b></tt><br> Then the service LINUX will be advertised in groups 0 and 10 (group 0 is always on by default). You could remove it from group 0 with the following command:<tt><b>latcp -g 0</b></tt><br> Set up like this, only terminal services listening for services in group 10 would see the LINUX service.</p> <p>The other group set (that manipulated by the -U and -u switches) determines which services can be used by the reverse-LAT ports. So, if you issue the following commands:<br> <tt><b>latcp -u 0<br> latcp -U 20</b></tt><br> Then you would only be able to connect reverse LAT ports to services that were advertised in group 20 (ie you could not connect to the LINUX service!). </p> <p></p> <h1>Other things you can fiddle with</h1> Most of the operational parameters of latd can be configured with latcp. I recommend you leave these alone unless you know what you are doing though. <ul> <li>Multicast timer(latcp -m). This timer specifies how often latd advertises its services on the LAN. It is specified in seconds and the default is 60.</li> <li>Keepalive Timer(latcp -k). This timer specifies how often latd will send a "keepalive packet" to a remote connection to see if it is still alive. This timer is restarted each time a valid packet is received. If <retransmit limit> keepalive packets are sent with no response then the connection is terminated. It is specified in seconds and the default is 20.</li> <li>Retransmit Limit(latcp -r). This is the number of keepalive packets sent before terminating a connection on the assumption that it is dead. The default is 20.</li> <li>Service responder(latcp -J or -j). Enables (-J) or disables (-j) service responder mode. This is needed if you have terminal servers on your network which don't collect advertised services but expect other machines to do it for them</li> </ul> <h1>llogin</h1> Starting with lat 1.02 a user program <i>llogin</i> is included. Like latcp this is based on the command of the same name from Tru64 Unix but with a few extras. It's purpose is to allow users to log into remote LAT services. These services must be made available to latd using the groups feature mentioned above. In its most basic form you can connect to an advertised LAT service with the command:<br> <pre>$ llogin trillian</pre> This command will connect you to the/a machine that advertises the service trillian and prompt you to log in. You can also specify a particular node or port number to connect to using command-line switches (see the man page for more details). One useful feature is the ability to connect to queued services by supplying the -Q switch to the command eg:<br> <pre>$ llogin ds200 -Rport_6 -Q</pre> Will connect to a queued port on a DECserver. Note that the service name, port name (and node name if supplied) will be converted to uppercase.<br> <br> Unlike using reverse-LAT ports you don't need to press enter (or any other key) to activate the connection. If the service is a login service then you will see the login prompt quite soon after entering the command.<br> <br> <br> <h1>What's happening with the server?</h1> You can show the status of the server with the <tt><b>latcp -d</b></tt> command which produces output something like this:<br> <pre><br>Node Name: TYKE LAT Protocol Version: 5.2<br>Node State: On LATD Version: 1.01<br>Node Ident: A Linux box<br><br>Service Responder : Disabled<br>Interfaces : eth1 eth0 <br><br>Circuit Timer (msec): 80 Keepalive Timer (sec): 20<br>Retransmit Limit: 20<br>Multicast Timer (sec): 30<br><br>User Groups: 0<br>Service Groups: 0<br><br>Service Name Status Rating Identification<br>TYKE Enabled 12 D <br>LINUX Enabled 100 D <br><br>Port Node Service Remote Port Queued<br>/dev/lat/marsinta DS200 PORT_8 Yes <br>/dev/lat/trillian DS200 PORT_7 Yes <br>/dev/lat/zaphod DS200 PORT_3 Yes <br>/dev/lat/roosta DS200 PORT_2 Yes <br>/dev/lat/loginmarsha MARSHA No <br>/dev/lat/ddcmp DS200 PORT_6 Yes 8<br></pre> The services shown are the services advertised by this machine. If you want to see a list of services that are on the network that have been seen by this machine(remember groups!) then use the command <tt><b>latcp -d -l</b></tt> which gives output like this: <pre>BACON Available Welcome to VAX/VMS V5.5 <br>BALTI Available Compaq Tru64 UNIX V5.0A LAT SERVICE<br>DS200 Available <br>LAT_VT_GTWY Available LAT/VT Gateway<br>LINUX Available Linux 2.2.18<br>MARSHA Available VAX node MARSHA<br>TRISHA Available <br>TYKE Available Linux 2.2.18<br><br></pre> If you really want the full lowdown on the services that latd has seen then the command <tt><b>latcp -d -l -v</b></tt> will tell you everything you wanted to know! <p></p> <h1>The startup script</h1> The above commands show you how to configure LAT, these commands will very likely be the same every time you boot the system or restart LAT so it makes sense to have some system of executing a series of commands every time you issue the <tt><b>latcp -s</b></tt> command and so there is. <p>Put your commands into a file called /etc/latd.conf and it will be run every time you start LAT. The only change you should make is to replace the latcp command with the string $LATCP so that the script can find the latcp program regardless of whether it is on the PATH or not.</p> <p>The reason you should use /etc/latd.conf rather than writing your own script to start LAT and then set the parameters is that latd does not actually advertise any services or accept any networkconnections until the startup script has completed. This means you can configure all the parameters and make sure that nothing happens with the defaults in place. Here is an example startup script that sets up the services shown in the above example output:</p> <p><pre># /etc/latd.conf<br># This is a sample configuration file for latd<br># it is run as s shell script from latcp -s with a minimal<br># environment and PATH (though latcp will be available as $LATCP)<br>#<br># You can fiddle with all the latd parameters you like in here, the first<br># service announcement will not be made until this script completes.<br>#<br>#<br><br># Set the multicast timeout to 30 seconds<br>$LATCP -m 30 <br><br># Add another login service<br>$LATCP -A -a LINUX -r 100<br><br># Add a queued reverse LAT service to consoles<br>$LATCP -A -p /dev/lat/marsinta -Vds200 -RPORT_8 -Q<br>$LATCP -A -p /dev/lat/trillian -Vds200 -RPORT_7 -Q <br>$LATCP -A -p /dev/lat/zaphod -Vds200 -RPORT_3 -Q <br>$LATCP -A -p /dev/lat/roosta -Vds200 -RPORT_2 -Q <br><br># LAT to VAX<br>$LATCP -A -p /dev/lat/loginmarsha -Vmarsha <br><br># DDCMP on Marsha<br>$LATCP -A -p /dev/lat/ddcmp -Vds200 -RPORT_6 -Q -8<br><br>exit<br></pre> </p> <p></p> <br> <hr width="100%"><br> <i>Compaq</i> and <i>Tru64 Unix</i> are trademarks of Compaq Computers Inc and <i>DECserver </i>probably is too.<br> <br> Go back to the <a href="index.html">DECnet for Linux Home Page</a> </body> </html> Index: README =================================================================== RCS file: /cvsroot/linux-decnet/latd/README,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** README 19 Feb 2001 19:17:02 -0000 1.5 --- README 12 Feb 2002 13:36:08 -0000 1.6 *************** *** 18,23 **** - Supports a group called "lat" to restrict users of reverse-LAT ports - llogin program so users can log into LAT services from Linux - To send BREAK to a remote server in a revsese-LAT session press ^@ ! You will need Packet Socket support in the kernel, but I think that's usually the default anyway. --- 18,24 ---- - Supports a group called "lat" to restrict users of reverse-LAT ports - llogin program so users can log into LAT services from Linux + - moprc for remote management for terminal servers. - To send BREAK to a remote server in a revsese-LAT session press ^@ ! You will need Packet Socket support in the kernel, but I think that's usually the default anyway. *************** *** 26,30 **** You should start latd with the latcp -s command. Starting latd manually ! is not supported and may result in unexpected behaviour. See the man page for latcp for more information. --- 27,31 ---- You should start latd with the latcp -s command. Starting latd manually ! is not supported and may result in unexpected behaviour. See the man page for latcp for more information. *************** *** 33,38 **** This software should work on all Linux architectures. I have tested it on ! Intel, SPARC and PowerPC. CREDITS --- 34,40 ---- This software should work on all Linux architectures. I have tested it on ! Intel, Alpha, SPARC and PowerPC. + More documentation is in the file lat.html CREDITS *************** *** 45,46 **** --- 47,50 ---- log in to the consoles of my VAX, Alpha, SPARC and MIPS machines. + I would also like to express gratitude to ABB for providing a DECserver 90M and + to Rob Davies for DECserver 90L+s. Index: TODO =================================================================== RCS file: /cvsroot/linux-decnet/latd/TODO,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** TODO 3 Jan 2002 08:46:55 -0000 1.12 --- TODO 12 Feb 2002 13:36:14 -0000 1.13 *************** *** 3,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 --- 3,8 ---- - Test service responder. ! - Find out we send so many more packets than Tru64. Probably related ! to the second item below. THINGS I MAY NOT DO Index: INSTALL =================================================================== RCS file: /cvsroot/linux-decnet/latd/INSTALL,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** INSTALL 16 Sep 2000 12:50:48 -0000 1.3 --- INSTALL 12 Feb 2002 13:36:17 -0000 1.4 *************** *** 26,30 **** -DNO_FORK prevent the daemon from forking into the background when run. Without this and without the -d flag, latd wil detach itself from the current process ! and run independantly. If you want to see the debug messges from -DVERBOSE_DEBUG then leave this option on or specify -d when you run latd. --- 26,30 ---- -DNO_FORK prevent the daemon from forking into the background when run. Without this and without the -d flag, latd wil detach itself from the current process ! and run independently. If you want to see the debug messges from -DVERBOSE_DEBUG then leave this option on or specify -d when you run latd. Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/latd/Makefile,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** Makefile 8 Feb 2002 15:06:52 -0000 1.28 --- Makefile 12 Feb 2002 13:36:19 -0000 1.29 *************** *** 1,5 **** # Makefile for LAT server ! VERSION=1.12 PKGNAME=latd --- 1,5 ---- # Makefile for LAT server ! VERSION=1.13 PKGNAME=latd *************** *** 98,102 **** latd/WARRANTY latd/COPYING latd/INSTALL latd/TODO \ latd/*.[1-8] latd/latd.conf latd/startlat.sh \ ! latd/rpm.spec latd/debian/* rpm: --- 98,102 ---- latd/WARRANTY latd/COPYING latd/INSTALL latd/TODO \ latd/*.[1-8] latd/latd.conf latd/startlat.sh \ ! latd/rpm.spec latd/*.html latd/debian/* rpm: Index: rpm.spec =================================================================== RCS file: /cvsroot/linux-decnet/latd/rpm.spec,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** rpm.spec 7 Jan 2002 15:56:35 -0000 1.3 --- rpm.spec 12 Feb 2002 13:36:22 -0000 1.4 *************** *** 27,31 **** ! %doc README NEWS --- 27,31 ---- ! %doc README NEWS latd.html |
From: Patrick C. <pa...@us...> - 2002-02-12 11:03:19
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv1571 Modified Files: latcp.8 Log Message: Tell users that -Q is needed for DS90L printer services. Index: latcp.8 =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcp.8,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** latcp.8 3 Jan 2002 08:46:55 -0000 1.8 --- latcp.8 12 Feb 2002 11:03:15 -0000 1.9 *************** *** 67,71 **** flag indicates that connections to the service is queued. If you connect to a queued service and it is busy then your connection ! will be forced to wait until it is available. .br The --- 67,72 ---- flag indicates that connections to the service is queued. If you connect to a queued service and it is busy then your connection ! will be forced to wait until it is available. You must use this flag ! for printer services on DECserver 90L terminal servers. .br The |
From: Patrick C. <pa...@us...> - 2002-02-11 16:39:38
|
Update of /cvsroot/linux-decnet/latd/debian In directory usw-pr-cvs1:/tmp/cvs-serv11602/debian Modified Files: changelog Log Message: A bit of code tidying (remove trailing blanks and code that should enver get run any more) More importantly - fix the queued reconnect bug. Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/latd/debian/changelog,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** changelog 11 Feb 2002 14:09:38 -0000 1.6 --- changelog 11 Feb 2002 16:39:35 -0000 1.7 *************** *** 7,11 **** * Primitive, but functional support for DS90L terminal servers ! -- latd (1.11-1) unstable; urgency=low --- 7,11 ---- * Primitive, but functional support for DS90L terminal servers ! -- Patrick Caulfield <pa...@de...> Mon, 11 Feb 2002 17:02:13 +0000 latd (1.11-1) unstable; urgency=low |
From: Patrick C. <pa...@us...> - 2002-02-11 16:39:38
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv11602 Modified Files: clientsession.cc localport.cc localportsession.cc queuedsession.cc serversession.cc Log Message: A bit of code tidying (remove trailing blanks and code that should enver get run any more) More importantly - fix the queued reconnect bug. Index: clientsession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/clientsession.cc,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** clientsession.cc 3 Jan 2002 08:46:55 -0000 1.24 --- clientsession.cc 11 Feb 2002 16:39:34 -0000 1.25 *************** *** 55,118 **** assert(!"Should never get here!!"); - - - credit = c; - strcpy(remote_service, service); - strcpy(remote_port, port); - - // A quick word of explanation here. - // We keep the slave fd open after openpty because otherwise - // the master would go away too (EOF). When the user connects to - // the port we then close the slave fd so that we get EOF when she - // disconnects. got that? - - if (openpty(&master_fd, - &slave_fd, NULL, NULL, NULL) != 0) - return -1; /* REJECT */ - - - // Set terminal characteristics - struct termios tio; - tcgetattr(master_fd, &tio); - tio.c_iflag |= IGNBRK|BRKINT; - tcsetattr(master_fd, TCSANOW, &tio); - - strcpy(remote_node, (char *)_remote_node); - 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; - if (stat(LAT_DIRECTORY, &st) == -1) - { - mkdir(LAT_DIRECTORY, 0755); - } - - // Link the PTY to the actual LTA name we were passed - if (ltaname[0] == '\0') - { - sprintf(ltaname, LAT_DIRECTORY "lta%d", local_session); - } - unlink(ltaname); - symlink(ptyname, ltaname); - - // Make it non-blocking so we can poll it - fcntl(master_fd, F_SETFL, fcntl(master_fd, F_GETFL, 0) | O_NONBLOCK); - - #ifdef USE_OPENPTY - // Set it owned by "lat" if it exists. We only do this for - // /dev/pts PTYs. - gid_t lat_group = LATServer::Instance()->get_lat_group(); - if (lat_group) - { - chown(ptyname, 0, lat_group); - chmod(ptyname, 0660); - } - #endif - - debuglog(("made symlink %s to %s\n", ltaname, ptyname)); - // LATServer::Instance()->add_pty(this, master_fd); return 0; } --- 55,58 ---- *************** *** 175,191 **** { 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); } --- 115,118 ---- *************** *** 287,294 **** // 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() { - close(slave_fd); return master_fd; } --- 214,220 ---- // Called from the slave connection - return the master fd so it can ! // can do I/O on it. int ClientSession::get_port_fd() { return master_fd; } Index: localport.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/localport.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** localport.cc 11 Feb 2002 14:09:38 -0000 1.4 --- localport.cc 11 Feb 2002 16:39:34 -0000 1.5 *************** *** 79,82 **** --- 79,84 ---- return; + debuglog(("openpty: master_fd=%d, slave_fd=%d\n", master_fd, slave_fd)); + // Send a request for the service if we are queued so that // by the time the user comes to use this port, we know about it. *************** *** 178,181 **** --- 180,184 ---- bool LocalPort::connect_session() { + debuglog(("localport::connect_session: master-fd = %d\n", master_fd)); return LATServer::Instance()->make_port_connection(master_fd, this, service.c_str(), remnode.c_str(), Index: localportsession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/localportsession.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** localportsession.cc 3 Jan 2002 08:46:55 -0000 1.2 --- localportsession.cc 11 Feb 2002 16:39:34 -0000 1.3 *************** *** 49,54 **** master_fd = fd; ! debuglog(("new localport session: localid %d, remote id %d\n", ! localid, remid)); state = STARTING; --- 49,54 ---- master_fd = fd; ! debuglog(("new localport session: localid %d, remote id %d, fd=%d\n", ! localid, remid, fd)); state = STARTING; Index: queuedsession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/queuedsession.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** queuedsession.cc 3 Jan 2002 08:46:55 -0000 1.2 --- queuedsession.cc 11 Feb 2002 16:39:34 -0000 1.3 *************** *** 40,44 **** QueuedSession::QueuedSession(class LATConnection &p, LAT_SessionStartCmd *cmd, ClientSession *_client, ! unsigned char remid, unsigned char localid, bool clean): ServerSession(p, cmd, std::string(""), 0,0, remid, localid, clean), --- 40,44 ---- QueuedSession::QueuedSession(class LATConnection &p, LAT_SessionStartCmd *cmd, ClientSession *_client, ! unsigned char remid, unsigned char localid, bool clean): ServerSession(p, cmd, std::string(""), 0,0, remid, localid, clean), *************** *** 47,56 **** max_read_size = cmd->dataslotsize; master_fd = client_session->get_port_fd(); ! ! debuglog(("new port session: localid %d, remote id %d, data slot size: %d, device fd: %d\n", localid, remid, max_read_size, master_fd)); } ! int QueuedSession::new_session(unsigned char *_remote_node, char *service, char *port, unsigned char c) --- 47,56 ---- max_read_size = cmd->dataslotsize; master_fd = client_session->get_port_fd(); ! ! debuglog(("new queued session: localid %d, remote id %d, data slot size: %d, device fd: %d\n", localid, remid, max_read_size, master_fd)); } ! int QueuedSession::new_session(unsigned char *_remote_node, char *service, char *port, unsigned char c) *************** *** 62,66 **** if (!client_session) return -1; ! debuglog(("starting port session: credit = %d\n", c)); strcpy(remote_node, (char *)_remote_node); --- 62,66 ---- if (!client_session) return -1; ! debuglog(("starting queued session: credit = %d\n", c)); strcpy(remote_node, (char *)_remote_node); *************** *** 86,90 **** master_fd = -1; ! /* Restart the client session */ client_session->restart_pty(); } --- 86,90 ---- master_fd = -1; ! /* Restart the client session */ client_session->restart_pty(); } Index: serversession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/serversession.cc,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** serversession.cc 3 Jan 2002 08:46:55 -0000 1.12 --- serversession.cc 11 Feb 2002 16:39:34 -0000 1.13 *************** *** 40,44 **** std::string shellcmd, uid_t uid, gid_t gid, ! unsigned char remid, unsigned char localid, bool clean): LATSession(p, remid, localid, clean), --- 40,44 ---- std::string shellcmd, uid_t uid, gid_t gid, ! unsigned char remid, unsigned char localid, bool clean): LATSession(p, remid, localid, clean), *************** *** 48,53 **** { max_read_size = cmd->dataslotsize; ! ! debuglog(("new server session: localid %d, remote id %d, data slot size: %d\n", localid, remid, max_read_size)); --- 48,53 ---- { max_read_size = cmd->dataslotsize; ! ! debuglog(("new server session: localid %d, remote id %d, data slot size: %d\n", localid, remid, max_read_size)); *************** *** 56,60 **** } ! int ServerSession::new_session(unsigned char *_remote_node, char *service, char *port, unsigned char c) --- 56,60 ---- } ! int ServerSession::new_session(unsigned char *_remote_node, char *service, char *port, unsigned char c) *************** *** 93,101 **** parent.send_message(buf,sizeof(LAT_Header),LATConnection::REPLY); ! slotbuf[slotptr++] = 0x01; // Service Class slotbuf[slotptr++] = 0x01; // Min Attention slot size slotbuf[slotptr++] = max_read_size; ! slotbuf[slotptr++] = 0x00; // Dest service length/name slotbuf[slotptr++] = 0x00; // Source service length/name --- 93,101 ---- parent.send_message(buf,sizeof(LAT_Header),LATConnection::REPLY); ! slotbuf[slotptr++] = 0x01; // Service Class slotbuf[slotptr++] = 0x01; // Min Attention slot size slotbuf[slotptr++] = max_read_size; ! slotbuf[slotptr++] = 0x00; // Dest service length/name slotbuf[slotptr++] = 0x00; // Source service length/name *************** *** 104,108 **** slotbuf[slotptr++] = 0x02; // Param Length 2 slotbuf[slotptr++] = 0x00; // Value 0 (woz 1024: 04 00) ! slotbuf[slotptr++] = 0x00; // slotbuf[slotptr++] = 0x04; // Param type 4 (PTY name) --- 104,108 ---- slotbuf[slotptr++] = 0x02; // Param Length 2 slotbuf[slotptr++] = 0x00; // Value 0 (woz 1024: 04 00) ! slotbuf[slotptr++] = 0x00; // slotbuf[slotptr++] = 0x04; // Param type 4 (PTY name) *************** *** 121,128 **** slotbuf[slotptr++] = 0x13; // Stop input char XOFF slotbuf[slotptr++] = 0x11; // Start input char XON ! // data_b slots count against credit ! // Hmm, this credit-starves queued connections // add_slot(buf, ptr, 0xaf, slotbuf, slotptr); // credit--; --- 121,128 ---- slotbuf[slotptr++] = 0x13; // Stop input char XOFF slotbuf[slotptr++] = 0x11; // Start input char XON ! // data_b slots count against credit ! // Hmm, this credit-starves queued connections // add_slot(buf, ptr, 0xaf, slotbuf, slotptr); // credit--; *************** *** 132,136 **** // Stuff the client full of credits add_slot(buf, ptr, 0x0f, slotbuf, 0); ! add_slot(buf, ptr, 0x0f, slotbuf, 0); slotbuf[slotptr++] = 0x0D; --- 132,136 ---- // Stuff the client full of credits add_slot(buf, ptr, 0x0f, slotbuf, 0); ! add_slot(buf, ptr, 0x0f, slotbuf, 0); slotbuf[slotptr++] = 0x0D; *************** *** 156,163 **** &slave_fd, NULL, NULL, NULL) != 0) return -1; /* REJECT */ ! strcpy(ptyname, ttyname(slave_fd)); state = STARTING; ! switch (fork()) { --- 156,163 ---- &slave_fd, NULL, NULL, NULL) != 0) return -1; /* REJECT */ ! strcpy(ptyname, ttyname(slave_fd)); state = STARTING; ! switch (fork()) { *************** *** 171,175 **** tio.c_oflag |= ONLCR; tcsetattr(slave_fd, TCSANOW, &tio); ! close(master_fd); if (fd != 0) dup2(fd, 0); --- 171,175 ---- tio.c_oflag |= ONLCR; tcsetattr(slave_fd, TCSANOW, &tio); ! close(master_fd); if (fd != 0) dup2(fd, 0); *************** *** 177,181 **** if (fd != 2) dup2(fd, 2); if (fd > 2) close (fd); ! setsid(); --- 177,181 ---- if (fd != 2) dup2(fd, 2); if (fd > 2) close (fd); ! setsid(); *************** *** 197,201 **** exit(-1); } ! case -1: // Failed syslog(LOG_ERR, "Error forking for /bin/login: %m"); --- 197,201 ---- exit(-1); } ! case -1: // Failed syslog(LOG_ERR, "Error forking for /bin/login: %m"); *************** *** 204,208 **** close(slave_fd); return -1; ! default: // Parent close(slave_fd); --- 204,208 ---- close(slave_fd); return -1; ! default: // Parent close(slave_fd); *************** *** 232,236 **** const char *cmdname; const char *thisarg; ! // Gather the args thisarg = strtok(cmd, " "); --- 232,236 ---- const char *cmdname; const char *thisarg; ! // Gather the args thisarg = strtok(cmd, " "); *************** *** 260,265 **** argv[argc++] = NULL; ! // Set some environment variables. ! // login will clear these it's true but other // services may find them useful. setenv("LAT_LOCAL_SERVICE", parent.get_servicename(), 1); --- 260,265 ---- argv[argc++] = NULL; ! // Set some environment variables. ! // login will clear these it's true but other // services may find them useful. setenv("LAT_LOCAL_SERVICE", parent.get_servicename(), 1); |
From: Patrick C. <pa...@us...> - 2002-02-11 14:09:42
|
Update of /cvsroot/linux-decnet/latd/debian In directory usw-pr-cvs1:/tmp/cvs-serv23904/debian Modified Files: changelog Log Message: Add support for DECserver 90L terminal servers with "printer" ports. Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/latd/debian/changelog,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** changelog 8 Feb 2002 15:24:18 -0000 1.5 --- changelog 11 Feb 2002 14:09:38 -0000 1.6 *************** *** 4,8 **** * New moprc program for remote administration of terminal servers * llogin can now connect to passworded services using llogin -w ! * Split out Linux-specific code into its own clas -- --- 4,9 ---- * New moprc program for remote administration of terminal servers * llogin can now connect to passworded services using llogin -w ! * Split out Linux-specific code into its own class ! * Primitive, but functional support for DS90L terminal servers -- |
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv23904 Modified Files: connection.cc interfaces-linux.cc lat.h lloginsession.cc localport.cc localportsession.h server.cc server.h utils.cc utils.h Log Message: Add support for DECserver 90L terminal servers with "printer" ports. Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -r1.36 -r1.37 *** connection.cc 8 Feb 2002 15:24:18 -0000 1.36 --- connection.cc 11 Feb 2002 14:09:38 -0000 1.37 *************** *** 967,973 **** int newsessionnum = next_session_number(); ! LATSession *newsession = new localportSession(*this, lport, 0, newsessionnum, (char *)localport, fd); ! if (newsession->new_session((unsigned char *)remnode, (char *)service, (char *)port, 0) == -1) { delete newsession; --- 967,973 ---- int newsessionnum = next_session_number(); ! lloginSession *newsession = new localportSession(*this, lport, 0, newsessionnum, (char *)localport, fd); ! if (newsession->new_session((unsigned char *)remnode, (char *)service, (char *)port, (char *)password, 0) == -1) { delete newsession; Index: interfaces-linux.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces-linux.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** interfaces-linux.cc 8 Feb 2002 15:06:52 -0000 1.1 --- interfaces-linux.cc 11 Feb 2002 14:09:38 -0000 1.2 *************** *** 265,269 **** &pack_info, sizeof(pack_info))) { ! syslog(LOG_ERR, "can't add remove socket multicast : %m\n"); return -1; } --- 265,269 ---- &pack_info, sizeof(pack_info))) { ! syslog(LOG_ERR, "can't remove socket multicast : %m\n"); return -1; } Index: lat.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/lat.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** lat.h 3 Jan 2002 08:46:55 -0000 1.8 --- lat.h 11 Feb 2002 14:09:38 -0000 1.9 *************** *** 39,42 **** --- 39,56 ---- } LAT_Header; + typedef struct + { + unsigned char cmd __attribute__ ((packed)); + unsigned char dummy __attribute__ ((packed)); + unsigned char hiver __attribute__ ((packed)); // Highest protocol version + unsigned char lover __attribute__ ((packed)); // Lowest protocol version + unsigned char latver __attribute__ ((packed)); // LAT version No. (5) + unsigned char latver_eco __attribute__ ((packed)); // LAT version No. (LSB) + unsigned short mtu __attribute__ ((packed)); // 1500 + unsigned short id __attribute__ ((packed)); + unsigned short retrans_timer __attribute__ ((packed)); + + } LAT_Enquiry; + // Service Announcement message typedef struct Index: lloginsession.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/lloginsession.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** lloginsession.cc 3 Jan 2002 09:45:17 -0000 1.10 --- lloginsession.cc 11 Feb 2002 14:09:38 -0000 1.11 *************** *** 60,63 **** --- 60,65 ---- strcpy(remote_pass, password); + debuglog(("lloginSession::new_session\n")); + // Make it non-blocking so we can poll it fcntl(master_fd, F_SETFL, fcntl(master_fd, F_GETFL, 0) | O_NONBLOCK); Index: localport.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/localport.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** localport.cc 8 Feb 2002 15:07:30 -0000 1.3 --- localport.cc 11 Feb 2002 14:09:38 -0000 1.4 *************** *** 79,82 **** --- 79,86 ---- return; + // Send a request for the service if we are queued so that + // by the time the user comes to use this port, we know about it. + LATServer::Instance()->send_enq((unsigned char *)remnode.c_str()); + // Set terminal characteristics struct termios tio; Index: localportsession.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/localportsession.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** localportsession.h 3 Jan 2002 08:46:55 -0000 1.2 --- localportsession.h 11 Feb 2002 14:09:38 -0000 1.3 *************** *** 1,4 **** /****************************************************************************** ! (c) 2001 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2001-2002 Patrick Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 21,25 **** virtual ~localportSession(); virtual void do_read(); ! private: LocalPort *localport; --- 21,26 ---- virtual ~localportSession(); virtual void do_read(); ! ! private: LocalPort *localport; Index: server.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.cc,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -r1.49 -r1.50 *** server.cc 8 Feb 2002 15:24:18 -0000 1.49 --- server.cc 11 Feb 2002 14:09:38 -0000 1.50 *************** *** 110,113 **** --- 110,162 ---- } + + // Send ENQUIRY for a service - mainly needed for DS90L servers that + // don't advertise. + void LATServer::send_enq(unsigned char *service) + { + unsigned char packet[1600]; + LAT_Enquiry *enqmsg = (LAT_Enquiry *)packet; + int ptr = sizeof(LAT_Enquiry); + + enqmsg->cmd = LAT_CCMD_ENQUIRE; + enqmsg->dummy = 0; + enqmsg->hiver = 5; + enqmsg->lover = 5; + enqmsg->latver = 5; + enqmsg->latver_eco = 2; + enqmsg->mtu = 1500; + enqmsg->id = 1; /* Something here */ + enqmsg->retrans_timer = 2; + + add_string(packet, &ptr, service); + packet[ptr++] = 1; /* Length of group data */ + packet[ptr++] = 1; /* Group mask */ + + add_string(packet, &ptr, (unsigned char*)"GRILLOCKS"); + + 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); + } + else + { + interface_errs[interface_num[i]] = 0; // Clear errors + } + } + + + } + /* Called on the multicast timer - advertise our service on the LAN */ void LATServer::send_service_announcement(int sig) *************** *** 466,470 **** if (len <= 0) { ! if (errno != EINTR) { syslog(LOG_ERR, "recvmsg: %m"); --- 515,519 ---- if (len <= 0) { ! if (errno != EINTR && errno != EAGAIN) { syslog(LOG_ERR, "recvmsg: %m"); *************** *** 527,532 **** case LAT_CCMD_CONACK: { debuglog(("Got connect ACK for %d\n", header->remote_connid)); ! LATConnection *conn = connections[header->remote_connid]; if (conn) { --- 576,586 ---- case LAT_CCMD_CONACK: { + LATConnection *conn = NULL; debuglog(("Got connect ACK for %d\n", header->remote_connid)); ! if (header->remote_connid <= MAX_CONNECTIONS) ! { ! conn = connections[header->remote_connid]; ! } ! if (conn) { *************** *** 587,590 **** --- 641,648 ---- break; + case LAT_CCMD_ENQREPLY: + got_enqreply(buf, len, ifn, macaddr); + break; + case LAT_CCMD_STATUS: forward_status_messages(buf, len); *************** *** 913,916 **** --- 971,995 ---- } + // Got a reply from a DS90L - add it to the services list + void LATServer::got_enqreply(unsigned char *buf, int len, int interface, unsigned char *macaddr) + { + int ptr = 23; + + /* Dont know the format of this packet before this... */ + + ptr += buf[ptr++]; /* Skip group codes; */ + + unsigned char nodename[32]; + get_string(buf, &ptr, nodename); + + /* Add it as a service. This is, technically, wrong but it will + do for the mo. */ + LATServices::Instance()->add_service(std::string((char*)nodename), + std::string((char*)nodename), + std::string((char*)"DS90L"), + 0, + interface, macaddr); + } + // Add services received from a service announcement multicast void LATServer::add_services(unsigned char *buf, int len, int interface, unsigned char *macaddr) *************** *** 1166,1170 **** std::list<serviceinfo>::iterator sii; sii = find(servicelist.begin(), servicelist.end(), name); ! if (sii != servicelist.end()) { cmd = sii->get_command(); --- 1245,1249 ---- std::list<serviceinfo>::iterator sii; sii = find(servicelist.begin(), servicelist.end(), name); ! if (sii != servicelist.end()) { cmd = sii->get_command(); *************** *** 1385,1392 **** ! // Called when activity is detected on a LocalPort - we connect it // to the service. int LATServer::make_port_connection(int fd, LocalPort *lport, ! const char *service, const char *rnode, const char *port, const char *localport, --- 1464,1471 ---- ! // Called when activity is detected on a LocalPort - we connect it // to the service. int LATServer::make_port_connection(int fd, LocalPort *lport, ! const char *service, const char *rnode, const char *port, const char *localport, *************** *** 1450,1454 **** // TODO: Different call into Connection() ! ret = connections[connid]->create_localport_session(fd, lport, service, port, localport, password); --- 1529,1533 ---- // TODO: Different call into Connection() ! ret = connections[connid]->create_localport_session(fd, lport, service, port, localport, password); *************** *** 1498,1502 **** output << "Service Responder : " << (responder?"Enabled":"Disabled") << std::endl; output << "Interfaces : "; ! for (int i=0; i<num_interfaces; i++) { output << iface->ifname(interface_num[i]) << " "; --- 1577,1581 ---- output << "Service Responder : " << (responder?"Enabled":"Disabled") << std::endl; output << "Interfaces : "; ! for (int i=0; i<num_interfaces; i++) { output << iface->ifname(interface_num[i]) << " "; Index: server.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** server.h 8 Feb 2002 15:06:52 -0000 1.32 --- server.h 11 Feb 2002 14:09:38 -0000 1.33 *************** *** 54,57 **** --- 54,58 ---- const unsigned char *get_user_groups() { return user_groups; } int find_connection_by_node(const char *node); + void send_enq(unsigned char *); private: *************** *** 95,98 **** --- 96,100 ---- void add_services(unsigned char *, int, int, unsigned char *); + void got_enqreply(unsigned char *, int, int, unsigned char *); void accept_latcp(int); void accept_llogin(int); Index: utils.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/utils.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** utils.cc 10 Feb 2001 12:22:49 -0000 1.3 --- utils.cc 11 Feb 2002 14:09:38 -0000 1.4 *************** *** 21,25 **** void add_string(unsigned char *packet, int *ptr, ! unsigned char *string) { int len = strlen((char *)string); --- 21,25 ---- void add_string(unsigned char *packet, int *ptr, ! const unsigned char *string) { int len = strlen((char *)string); Index: utils.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/utils.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** utils.h 10 Feb 2001 12:22:49 -0000 1.3 --- utils.h 11 Feb 2002 14:09:38 -0000 1.4 *************** *** 15,19 **** void add_string(unsigned char *packet, int *ptr, ! unsigned char *string); void get_string(unsigned char *packet, int *ptr, --- 15,19 ---- void add_string(unsigned char *packet, int *ptr, ! const unsigned char *string); void get_string(unsigned char *packet, int *ptr, |
From: Patrick C. <pa...@us...> - 2002-02-08 15:24:22
|
Update of /cvsroot/linux-decnet/latd/debian In directory usw-pr-cvs1:/tmp/cvs-serv7629/debian Modified Files: changelog Log Message: Remove references to Linux as the code is supposedly "portable" now(!) and move all the linux-specific bits that are left inside #ifdefs Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/latd/debian/changelog,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** changelog 3 Jan 2002 09:45:17 -0000 1.4 --- changelog 8 Feb 2002 15:24:18 -0000 1.5 *************** *** 4,7 **** --- 4,8 ---- * New moprc program for remote administration of terminal servers * llogin can now connect to passworded services using llogin -w + * Split out Linux-specific code into its own clas -- |
From: Patrick C. <pa...@us...> - 2002-02-08 15:24:21
|
Update of /cvsroot/linux-decnet/latd In directory usw-pr-cvs1:/tmp/cvs-serv7629 Modified Files: connection.cc interfaces.cc interfaces.h latcp.cc main.cc server.cc Log Message: Remove references to Linux as the code is supposedly "portable" now(!) and move all the linux-specific bits that are left inside #ifdefs Index: connection.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/connection.cc,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -r1.35 -r1.36 *** connection.cc 8 Feb 2002 15:07:30 -0000 1.35 --- connection.cc 8 Feb 2002 15:24:18 -0000 1.36 *************** *** 478,482 **** add_string(reply, &ptr, server->get_local_node()); add_string(reply, &ptr, remnode); ! add_string(reply, &ptr, (unsigned char*)"LAT for Linux"); reply[ptr++] = '\0'; --- 478,482 ---- add_string(reply, &ptr, server->get_local_node()); add_string(reply, &ptr, remnode); ! add_string(reply, &ptr, (unsigned char*)"GPL LATD"); reply[ptr++] = '\0'; *************** *** 883,887 **** add_string(buf, &ptr, LATServer::Instance()->get_local_node()); buf[ptr++] = 0; // ASCIC source port ! add_string(buf, &ptr, (unsigned char *)"LAT for Linux"); add_string(buf, &ptr, servicename); add_string(buf, &ptr, portname); --- 883,887 ---- add_string(buf, &ptr, LATServer::Instance()->get_local_node()); buf[ptr++] = 0; // ASCIC source port ! add_string(buf, &ptr, (unsigned char *)"GPL LATD"); add_string(buf, &ptr, servicename); add_string(buf, &ptr, portname); *************** *** 916,920 **** add_string(buf, &ptr, remnode); add_string(buf, &ptr, LATServer::Instance()->get_local_node()); ! add_string(buf, &ptr, (unsigned char *)"LAT for Linux"); return send_message(buf, ptr, LATConnection::DATA); --- 916,920 ---- add_string(buf, &ptr, remnode); add_string(buf, &ptr, LATServer::Instance()->get_local_node()); ! add_string(buf, &ptr, (unsigned char *)"GPL LATD"); return send_message(buf, ptr, LATConnection::DATA); Index: interfaces.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** interfaces.cc 8 Feb 2002 15:06:52 -0000 1.1 --- interfaces.cc 8 Feb 2002 15:24:18 -0000 1.2 *************** *** 16,19 **** --- 16,24 ---- #include "interfaces.h" + #ifdef __linux__ + #include "interfaces-linux.h" + #endif + + LATinterfaces::LATinterfaces() { *************** *** 22,24 **** --- 27,39 ---- LATinterfaces::~LATinterfaces() { + } + + + LATinterfaces *LATinterfaces::Create() + { + #ifdef __linux__ + return new LinuxInterfaces(); + #endif + + // TODO Stick others here... } Index: interfaces.h =================================================================== RCS file: /cvsroot/linux-decnet/latd/interfaces.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** interfaces.h 8 Feb 2002 15:06:52 -0000 1.1 --- interfaces.h 8 Feb 2002 15:24:18 -0000 1.2 *************** *** 60,62 **** --- 60,65 ---- // Close an interface. virtual int close_connection(int ifn)=0; + + // Creates a platform-specifc interfaces class + static LATinterfaces *Create(); }; Index: latcp.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/latcp.cc,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** latcp.cc 8 Feb 2002 15:07:30 -0000 1.28 --- latcp.cc 8 Feb 2002 15:24:18 -0000 1.29 *************** *** 798,801 **** --- 798,802 ---- // /proc/<pid>/exe + #ifdef __linux__ sprintf(latcp_proc, "/proc/%d/exe", getpid()); if ( (i=readlink(latcp_proc, latcp_bin, sizeof(latcp_bin))) == -1) *************** *** 804,807 **** --- 805,811 ---- exit(2); } + #else + #error OK, a bit more porting work needed here too. + #endif sprintf(latcp_env, "LATCP=%s", latcp_bin); Index: main.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/main.cc,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** main.cc 8 Feb 2002 15:07:30 -0000 1.16 --- main.cc 8 Feb 2002 15:24:18 -0000 1.17 *************** *** 93,97 **** #endif ! strcpy(greeting, "A Linux box"); interface[0] = '\0'; memset(interfaces, 0, sizeof(interfaces)); --- 93,97 ---- #endif ! strcpy(greeting, "GPL LATD by Patrick Caulfield"); interface[0] = '\0'; memset(interfaces, 0, sizeof(interfaces)); Index: server.cc =================================================================== RCS file: /cvsroot/linux-decnet/latd/server.cc,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -r1.48 -r1.49 *** server.cc 8 Feb 2002 15:07:30 -0000 1.48 --- server.cc 8 Feb 2002 15:24:18 -0000 1.49 *************** *** 57,62 **** #include "server.h" #include "services.h" - //#include "interfaces.h" - #include "interfaces-linux.h" #include "lat_messages.h" #include "dn_endian.h" --- 57,60 ---- *************** *** 368,372 **** // until we get an UNLOCK message from latcp. ! // We rely on Linux's select() behaviour in that we use the // time left in the timeval parameter to make sure the circuit timer // goes off at a reasonably predictable interval. --- 366,370 ---- // until we get an UNLOCK message from latcp. ! // We rely on POSIX's select() behaviour in that we use the // time left in the timeval parameter to make sure the circuit timer // goes off at a reasonably predictable interval. *************** *** 802,806 **** /* Initialise the platform-specific interface code */ ! iface = new LinuxInterfaces(); if (iface->Start() == -1) { --- 800,804 ---- /* Initialise the platform-specific interface code */ ! iface = LATinterfaces::Create(); if (iface->Start() == -1) { |